Because the code is stored within the page or within a linked file, it is downloaded into the browser when a user accesses the page and, therefore, doesn't require a roundtrip to the server.
For this reason, client form validation can be faster than server-side validation.
However, client-side validation may not work in all instances.
A user may have a browser that doesn't support client-side scripting or may have scripting disabled in the browser.
The validation script in this article returns a Boolean value that specifies whether the data contained in the form is valid. Variables are not required, but they make accessing each field easier.
To create your own custom function, insert a SCRIPT element into the HEAD section of your form page; within the SCRIPT element, use the function statement to insert a function named Validate Contact Form. This code should look something like the following code sample. Starting script function To access the form fields within the code, you should create variables. For example, without a variable, you would have to type document. Name every time you needed to access the Name field.
Because the code is stored on the server, server-side validation requires a roundtrip to the server.
Important JScript is Microsoft's implementation of ECMAScript, as defined by the specification of the European Computer Manufacturers Association.
Both Java Script and JScript are ECMAScript-compliant languages.
The action attribute tells the browser what to do when a user submits the form.
If you want to test this form, change this e-mail address to your own e-mail address.