You can control how validation errors are displayed by defining CSS classes that have the following reserved names: .
These pairs let you define rules for both conditions: an error condition and a "normal" (non-error) condition.
When you submit a form to a CGI program that resides on the server, it is usually programmed to do its own check for errors.
If it finds any it sends the page back to the reader who then has to re-enter some data, before submitting again.
In this example, the test for a valid date won't work in client code.
However, the test will be performed in server code.
Users get immediate feedback, which is convenient for them.
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.A disadvantage of this approach is that users don't know that they've made an error until after they submit the page.If a form is long or complex, reporting errors only after the page is submitted can be inconvenient to the user.A Java Script check is useful because it stops the form from being submitted if there is a problem, saving lots of time for your readers.The CGI script is still more reliable, as it always works regardless of whether Java Script is enabled on the client-side or not; but having this extra safety barrier is a nice thing to have in place.Usually you'll just want to check if Modern Web Design Using Java Script & DOMJava Script is back! This is the best book on the subject I’ve ever read, showing you step-by-step the smartest ways to create usable, useful DHTML effects to enhance your site. Note Even if you use client-side validation, validation is always also performed in server code.Performing validation in server code is a security measure, in case users bypass client-based validation.Note Important Validating user input is also important for security.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.