pure connections dating site - Validating radio buttons with javascript

by  |  22-Dec-2017 20:31

Conversely, if the form validation function returns the boolean value of true, the HTML event knows that it can continue with submission of the user input.

In the Java Script function, we get the "first_name" HTML element, identify if there is input and return true or false depending on the input.

We obtain a reference to the group of radio buttons using the name of the group, and then iterate over all the radio button objects to test which one of them is checked.

For instance, the address input box might be required, but you have a second address input box for apartments or suite numbers.

You'd put an asterisk next to the first address field but not the second.

You can also perform this type of validation with other form elements.

Usually, any required fields are marked for your users, so they know that they need to enter a value in specific fields.

You can customize7 these form elements using CSS, Java Script or inline HTML tag properties.

Community Discussion