Validating checkboxes in java script
For example, you may want to ensure that someone inserts a valid e-mail address into a text box, or perhaps you want to ensure that someone fills in certain fields.
Microsoft® Office Front Page® 2003 allows you to create some custom validation within the form feature.
(For more information on how to create form validation using the Front Page form feature, see About creating forms in Front Page 2003.) However, if the form validation provided in Front Page does not suit your needs or the site on which you are working is hosted on a server that does not have Front Page Server Extensions from Microsoft installed, you may need to create custom form validation.
However, for some form functions, server-side validation is necessary.
For example, if you have a form that populates a drop-down list based on the value of another form field, server-side processing may be needed to pull data from a database and populate the drop-down list.
The following function checks whether the texbox with id name1 is empty, if empty it displays a message and highlights that textbox with red color.
We use return false; because when this function is called when the form is submitted and if this textbox is found empty the page shouldn’t be submitted so returning the boolean value false with prevent the form from being submitted.
Client-side validation provides validation within the browser on client computers through Java Script.