Guys i need help woth javascript

Discussion in 'Web Design & Coding' started by InSaN|tY, Sep 9, 2003.

  1. InSaN|tY

    InSaN|tY OSNN Junior Addict

    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
     
  2. punkandacoke

    punkandacoke eat me

    Messages:
    255
    Location:
    at the end of the rainbow
    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.

    -.-
     
  3. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    sounds like homework 8)