Help with multiple pages login procedure

Results 1 to 2 of 2

Thread: Help with multiple pages login procedure

  1. #1
    Join Date
    Dec 1969

    Default Help with multiple pages login procedure

    I am building a registration process in 5 steps with 5 pages. All variable have to be past from page to page and on page 5 it is submitted in a Database. On page 1, they create an account and I have the following problem:<BR><BR>How do I check the data first for valid format using a Javascript and then check if the username already exists in the database, BEFORE I proceed to page 2?<BR><BR>At this moment I have:<BR><BR>1) Page contains a form with input boxes for username, pwd, and re-type pwd.<BR>2) Submit button that calls a JavaScript function verify() that verifies the usual format checks<BR>3) If something is wrong an alert gives the error message<BR>4) If the format is correct it submits the form using: document.form.submit()<BR>5) The action for the form is &#060;FORM ACTION="page2.asp" METHOD="post"&#062;<BR>6) All variables are passed to page2 where more information is asked.<BR><BR>NOW: the big question somewhere in this process, the username that is given must be checked if it already exists in the database. I know how to check this, but where do I declare and call this function?? From the JavaScript?? I am not asking how to check if the username exist already, I know this but I just do not know where to declare this function and how to call it.<BR>Somehow AFTER the verify() function, but BEFORE loading page2.asp, the database must be opened and checked for the username.<BR><BR>I do not want the username to be checked on page 2 because I don&#039t want to load any "error" pages. I just want to use alerts and msgBox&#039es for speed. Only when verify() gives no error and the username does not exist do I want to load another page: page 2. PLEASE: can anybody tell me how this can be done?

  2. #2
    Join Date
    Dec 1969

    Default RE: Help with multiple pages login procedure

    As the first task on page 1 have some ASP pull all of the usernames from the database and load them into a javascript array.<BR><BR>Then alter your javascript validation function to do its usual checks, but also check to see if the username they have provided matches an entry in the array you just loaded up. If it does then do your alert, otherwise the user can proceed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts