Guys i need help woth javascript

InSaN|tY

OSNN Junior Addict
Joined
22 Feb 2004
Messages
30
Ok i know this is too much to ask, but i have to create this login page here's a description

A GUI login screen is to be displayed with the following GUI objects:

- userID text box named "txtUserID"
- password text box named "txtpassword"
- login button to call "authenticate(userIn, passIn)" named "btnLogin"
- appropriate prompts and messages

create the code in three modules (files):

login.html
- displays the GUI login screen


init.js (instead of owners.js, managers.js)
- initializes variables
- populates data arrays
the data for these will be provided as two lists of names & passwords
one list will contain names of managers and the other will be owners

login.js
- holds the functions
1. authenticate(userIn, passIn)
2. goToURL(nextWebPage)

Description of the Login authentication program:

We need to identify the user type as manager, owner or ordinary

when the user attempts to log in to the system
- the lists of users is searched for a match with the userID
- if a match for userID is found, the pIN is checked
if the pIN is correct the user is admitted to the system either as a manager or an owner
- otherwise the user is prompted to check the userID and pIN or to proceed to the ordinary user's page

glossary:

authentication = the user's userID and pIN are verified
attempt to log in = user enters userID and pIN
userID = 3 to 14 characters
pIN = 4 digit number
admitted to the system as owner = display Owner's Welcome page
admitted to the system as manager = display manager's Welcome page
Suggested steps for the solution:

1. Store userID's and PIN's in parallel arrays or a single object array;

example of parallel arrays

userID = new Array("Fred", "Sally", "Judy");
pIN = new Array( 0000, 1111 ,2222);

2. get the items entered by the user from the form; eg.

onClick= "authenticate(user, pin)"

3. Search the userID array for a match; eg.

for (i = 0; i < userID.length; i++)
{ if (userID == user)
{ processPin;
break;
}
... and so on

Suggested preliminary steps:

-2. experiment with getting data from a form

-1. experiment with the arrays of users; eg.
display their userID's and pIN's on the screen
with a function called displayUsers()

function displayUsers()
{ document.write("Number userID pIN ");
for (i = 0; i < userID.length; i++)
{ document.write(i + ". " + userID + " " pIN + "."); }
}


does anyone know where i can find soething that wud help me with this, or could anyone here help me with this? Thx in advance
 
um. holy **** man. gimme about six days and ill have it for you. havent used js in A LONG WHILE. so i mean ill try. i hope i can help.

-.-
 
sounds like homework 8)
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back