How to move to the corresponding page upon clicking submit button?

Results 1 to 2 of 2

Thread: How to move to the corresponding page upon clicking submit button?

  1. #1
    Marie Guest

    Default How to move to the corresponding page upon clicking submit button?

    Upon Clicking on Submit button, if the data is correct, it will move to a page. Else it will have a pop-up msg, indicating which data is not valid and will remain on the Submit page.<BR><BR>I am using VBScript,<BR>Sub Submit_OnClick()<BR> If Name="" THEN<BR> ??????????????? &#060;remain at submit page><BR> Else<BR> ??????????????? &#060;Move the a page><BR> End If<BR>End Sub<BR><BR>What is the statements to put in??<BR><BR>*Urgent*<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    35

    Default RE: How to move to the corresponding page upon clicking submit button?

    Okay this is actually very simple. Let me include the code from a samle page that you can work with:<BR>&#060;form name="form"><BR>&#060;input type=text value="lastname" name="lastname"><BR><BR>&#060;input type=text value="firstname" name="firstname"><BR><BR>&#060;input type=submit name="Submit" value="Submit"><BR>&#060;/form><BR>&#060;script language=vbscript><BR>sub Submit_onClick<BR>if window.document.form.lastname.value = "lastname" or window.document.form.firstname.value = "firstname" then<BR> alert("You must enter something in each field")<BR> exit sub<BR>else<BR> window.document.form.action = "validation.asp"<BR> window.document.form.method = "post"<BR>end if<BR>end sub<BR>!!!Importsnt notes: Notice that the action and method properties are only defined if the values of the fields are valid. Don&#039t define them in the form tags.

Posting Permissions

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