Validating radio button in javascript cuba international ladies dating site 2016

validating radio button in javascript-19validating radio button in javascript-37

In actual fact the setup of these fields is the most simple of all form fields to validate as radio buttons set one value that only needs to be tested when the form is submitted.

The difficulty with radio buttons is that there are at least two and usually more fields that need to be placed on the form, related together and tested as one group.

If no option has been selected, then an alert message will tell the user to select an option and the form will not submit the data until an option has been selected.

Watch the video below and then scroll down to see the sample code.

We need to check if it is equal to null or “” because different browsers act differently so its better to check for both the conditions.

Comments