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.
However, in the example above, all input fields are optional.
In all cases, the form is called That's checking the value's equality with a null String (two single quotes with nothing between them).
When you are asking a reader for their email address, you can use a simple » address validation function to make sure the address has a valid structure. Each option in a drop-down box is indexed in the array Annoyingly, there is no simple way to check which radio button out of a group is selected — you have to check through each element, linked with Boolean AND operators .
We're going to be checking the form using a function, which will be activated by the form's Validating this form would be considerably simpler than one containing radio buttons or select boxes, but any form element can be accessed.
Below are the ways to get the value from all types of form elements.
It makes your page much more user-friendly, and takes out the frustration of having to fill out the same form repeatedly.