Javascript Help

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Dune44
Forum Newbie
Posts: 1
Joined: Tue Jun 09, 2009 10:12 pm

Javascript Help

Post by Dune44 »

I don't really have much Experience with Coding at all but I usually get by on my Own. But this I am Having a little Trouble with this one.

It's the login Script that I am using, I wish to modify it.

Right now Each user will have a Username and Password, Each User will also have a Specific Page that
they will be taken to once logged in Correctly. In my case they are all going to the Same page. BUT!
With the Exception, I also want to Open up a Javascript Popup, for Each user. This Popup will be
different for each user, as well as need the Java pop up to be a Certain Size, Not being able to Move the Side or Bottom
Scroller. I can do this on my Own I just can't integrate it into this Code. ALSO* I was wondering if I could Only Display a Certain
Part of the Page in the Javascript, ( Like say the Middle Right part of the Page ) if anyone can help it would be Greatly Appreciated.

Code: Select all

 
 
!-- TWO STEPS TO INSTALL MULTIPLE USERS
 
   1.  Copy the first code into the HEAD of your HTML document
   2.  Put the last coding into the BODY of your HTML document  --
 
!-- STEP ONE Copy this code into the HEAD of your login HTML document  --
 
HEAD
 
SCRIPT LANGUAGE=JavaScript
 
!-- This script and many more are available free online at --
!-- The JavaScript Source!! httpjavascript.internet.com --
 
!-- Begin
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username==member1 && password==password1) { window.location=page1.html; done=1; }  [b]< ----this is where I wish to add the POPUP code, With Each one.*[/b]
if (username==member2 && password==password2) { window.location=page2.html; done=1; }  <----
if (username==member3 && password==password3) { window.location=page3.html; done=1; }  <---- And so on and So on.  
if (done==0) { alert(Invalid login!); }
}
 End --
SCRIPT
 
!-- STEP TWO Paste this code into the BODY of your HTML document  --
 
BODY
 
center
form name=login
table width=225 border=1 cellpadding=3
trtd colspan=2centerfont size=+2bMembers-Only Area!bfontcentertdtr
trtdUsernametdtdinput type=text name=usernametdtr
trtdPasswordtdtdinput type=text name=passwordtdtr
trtd colspan=2 align=centerinput type=button value=Login! onClick=Login()tdtr
table
form
center
 
pcenter
font face=arial, helvetica size=-2Free JavaScripts providedbr
by a href=httpjavascriptsource.comThe JavaScript Sourceafont
centerp
 
!-- Script Size  1.60 KB  --
 
Last edited by Benjamin on Tue Jun 09, 2009 11:30 pm, edited 2 times in total.
Reason: Added [code=text] tags.
dejvos
Forum Contributor
Posts: 122
Joined: Tue Mar 10, 2009 8:40 am

Re: Javascript Help

Post by dejvos »

I' m not sure If I get the point of the question, so did you try for window opening:

Code: Select all

 
window.open('script.php?='+parms,'window_name','heigth=200,width=300,scrollbars=no,resizabel=no');
 
than you should hide parts of pages by php. If you cannot use php you shoud send page width all parts of width display: none and then by Javascript make visible only the part which you want.

Code: Select all

 
$('id_of_you_requested_part').setStyle('display','block');
 
Post Reply