To: Ian Stalling. In Ref. to "Input Valid Data"

Results 1 to 2 of 2

Thread: To: Ian Stalling. In Ref. to "Input Valid Data"

  1. #1
    Marie Guest

    Default To: Ian Stalling. In Ref. to "Input Valid Data"

    This my part of my program, I&#039ve not try session object b4. I&#039ve studied the help you gave me but I&#039m still not sure what and where to put in the instructions. Can you help me on where to put the session object and I&#039ll still be able to remain at that page with other valid data after an empty field is found. <BR>Thanks <BR><BR>&#060;Form NAME="Form"><BR>&#060;TABLE><BR>&#060;TR> <BR>&#060;TD>Name:&#060;/TD><BR>&#060;TD>&#060;INPUT TYPE="text" NAME="SName" SIZE=30>&#060;/TD><BR>&#060;/TR><BR>&#060;TR><BR>&#060;TD>Student Number:&#060;/TD><BR>&#060;TD>&#060;INPUT TYPE="text" NAME="SNum" SIZE=30> &#060;/TD><BR>&#060;/TR><BR>&#060;INPUT NAME="Submit" TYPE=Submit Value="Submit">&#060;/TD><BR>&#060;/TABLE><BR>&#060;/FORM><BR><BR>&#060;Script Language ="Vbscript"><BR>Sub Submit_OnClick<BR> If window.document.form.SName.value="" Then<BR> alert("Please Input Your Name.")<BR> Exit sub<BR><BR>Elseif window.document.form.SNum.value="" Then<BR> alert("Please Input Your Student Number.")<BR> Exit sub<BR><BR>Else<BR> window.document.form.action="confirm.asp"<BR> window.document.form.method="post"<BR>End if<BR>End Sub <BR>&#060;/script>

  2. #2
    Ian Stallings Guest

    Default RE: To: Ian Stalling. In Ref. to

    This is a little different since the check is done<BR>on the client. The session object can only be set using<BR>server side scripting. So if it was checked on the server<BR>you could then set the session object. <BR><BR>But Since you are using client side I would recommend<BR>using a vbscript routine to check the field BEFORE they <BR>hit the submit button. I think you can use the onBlur method<BR>to check the field as soon as they type it in and go on to the <BR>next. To be honest this is not my area where my knowledge is at<BR>so I would check with others to verify it.<BR><BR>I hope this helps.

Posting Permissions

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