View Full Version : Client side validation

Bob Burns
07-16-2004, 08:18 PM
Hi Everyone,
I have another question for you. I have a form with two dropdown list cbosupplier1 and cbosupplier2 and one textbox txtKeywords and a Go button btnsubmit. I would like to perform some client side validation before posting the results to the server. I though I could create a javascript function as follows

function validate_user_input()
if(document.searchform.cbosupplier1.SelectedItem != 0 && document.searchform.cboSupplier2.SelectedItem !=0 !! document.searchform.txtKeywords != "")
return true;
}//end of if
return false
}//end of else

}//end of function

so in the forms onsubmit event procedure i would call the validate user input function, but i also want to call another method in my asp.net code if and only if that function defined above evaluates to true

so in my asp.net code I would create the search forms OnSubmit event procedure which will be called after the javascript function evaluates to true.
Could someone help me describe how I would go around doing this??
Thanks Bob.

07-16-2004, 09:46 PM
you should repost this in the Java Script (client side) forum section.