Server Side Validation!

Results 1 to 2 of 2

Thread: Server Side Validation!

  1. #1
    Join Date
    Dec 1969

    Default Server Side Validation!

    I have a Javascript function enclosed within the &#060;SCRIPT&#062; Tag which I call to validate a form on clicking the Submit button;<BR><BR>E.g: function validate() {<BR> strval = mainform.Name.value;<BR> if (strval == &#039;&#039;) {<BR> alert(&#039;The Name is required field.&#039;);<BR> event.returnValue=false;<BR> }<BR> }<BR><BR>And my Form Tag looks like this;<BR>&#060;FORM name="mainform" onSubmit="validate();" action="proj.asp" method="POST"&#062;<BR><BR>On submitting this form, the information goes into a database. However along with this validation, I want to make another validation which would check if the value of mainform.Name.value already exists in the database. For that I presume, I have to make a server-side validation, checking the value of &#039;Name&#039; in each recordset.<BR><BR>How do I acheive to execute both these validations together and how can I refer to the recordset in my existing function.<BR><BR>Thank You so Much for any help!

  2. #2
    Join Date
    Dec 1969

    Default RE: Server Side Validation!

    You can&#039;t refer to your recordset in your JS function... You have to do some client side validation like you are doing... Then, on the server side, check for the record... If it exists, don&#039;t insert it and give the user a message on the page... If it does not exist, insert and display a successful insert message... That should happen in your proj.asp<BR><BR>HTH...

Posting Permissions

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