JSFiddle - React, Tailwind, and code Playground
by robp2175
HTML
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.0/jquery.validate.js"></script>
<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>
JavaScript
$(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);
}
});
});