lundi 29 juin 2015

HTML5 Browser Validation for Checkboxes - given multiple checkboxes how can I make sure at-least one is selected?

Given something simple like this:

<form ...>
<input type="checkbox" required name="op1"> Option 1</u>
<input type="checkbox" required name="op2"> Option 2</u>
<input type="submit">
</form>

Is there any way using HTML5 Validation to validate if one of the boxes are checked and if none are selected to focus the required tooltip on the form?




Aucun commentaire:

Enregistrer un commentaire