Validating asp forms
At the end, there's a little exercise to keep you busy too!
Form validation is the process of checking that a form has been filled in correctly before it is processed.
Let's build a simple form with a validation script.
The form will include one text field called "Your Name", and a button.
Here, we use the validation controls to validate the user input.
Server-side validation is more secure but often more tricky to code, whereas client-side (Java Script) validation is easier to do and quicker too (the browser doesn't have to connect to the server to validate the form, so the user finds out instantly if they've missed out that required field! In this tutorial we'll build a simple form with client-side Java Script validation.
You can then adapt this form to your own requirements.
You do not have to disable the Form’s Auto Validate property.
However, I prefer to call it explicitly and handle all validation at once since you most likely will take action only if the entire control’s children pass validation. The most important thing to recognize here is how precise you can be with the validation error message in the error provider.
This kind of situation is handled using validation groups.