I have been trying to validate that a check is checked, but so far have been unable to get anything to work. So far I have some Jquery that makes sure no more than one checkbox is selected.
I would appreciate any assistance to get this to work with my current code.
<form id="gradform" name="form1" method="post" action="index.php">
<input type='checkbox' name='may' id='may' value='1' class='unique' data-group='mog'>
<input type='checkbox' name='august' id='august' value='2' class='unique' data-group='mog'>
<input type='checkbox' name='december' id='december' value='3' class='unique' data-group='mog'>
<input type="submit" name="submit" value="submit" id="submit">
</form>
$(document).ready(function() {
$('input.unique').click(function() {
if (!$(this).prop('checked')) {
return;
}
var group = $(this).data('group');
if (group) {
$('input[data-group="' + group + '"]:checked').prop('checked', false);
$(this).prop('checked', true);
}
});
});