Validating input in java script
However, client-side validation may not work in all instances.
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.In addition, each of the fields should have a unique name.Use the following table to assign names to all of your form elements.You need a custom function that you can later connect to the form.For more information about creating a function, see JScript Functions.
Search for validating input in java script:
In addition, this article assumes a general understanding of HTML and Java Script, although a thorough understanding is not required.