Client-based validation can also reduce the number of times that the user has to submit the form to correct multiple errors.
If a form is long or complex, reporting errors only after the page is submitted can be inconvenient to the user.
You can add support to perform validation in client script.
When you restrict the values that users can enter in forms, you reduce the chance that someone can enter a value that can compromise the security of your site.
To see how validation works, run this page and deliberately make mistakes.
If a user enters a non-integer value, the error is reported as soon as the user leaves the entry field.
Users get immediate feedback, which is convenient for them.
The CSS rules that end in to both have the same fixed size.
That way, the display area for the field is static and won't change the page flow if an error message is displayed.
This article discusses how to validate information you get from users — that is, to make sure that users enter valid information in HTML forms in an ASP. What you'll learn: If you ask users to enter information in a page — for example, into a form — it's important to make sure that the values that they enter are valid.