Would you like to answer one of these unanswered questions instead?
We invite you to try Form Breeze absolutely free of charge.
We'll also look at how to check other types of fields, such as checkboxes, radio buttons and drop-down lists.
Let's look at a more complex validated form with some different types of form fields. Try pressing the Send Details button without filling in the form and see what happens.
See HTML5: How to use the "required" attribute with a "radio" input field for more information on how to do this well. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Our example is very simple as it only checks one field.
Let's expand this example with a more complex function that checks lots of form fields.
One point to note about Java Script validation is that it can always be circumvented by the user disabling Java Script in their browser, so for secure validation you'll need to write your validating code in your server-side scripts.
However, for day-to-day use Java Script is a quick and easy way to check over your forms before they're sent to your server.
when submit button is pressed and no radio buttons have been selected, it alerts the user saying 'please select a check box', and if a radio button has been selected then simply submit the form, needs no alert.