Need help with a function to enable only one checkbox for single selection or multiple checkboxes for multiple selection. Use MultipleCheckbox(0) for single selection or MultipleCheckbox(1) for multiple selection.
function MultipleCheckbox(elem){
if (elem ==0){
$('input[type="checkbox"]').on('change', function() {
$('input[type="checkbox"]').not(this).prop('checked', false);
});
} else {
$('input[type=checkbox]').each(function() {
$('input[type="checkbox"]').prop('checked', false);
});
}
}
<table style="text-align: center;">
<tbody>
<tr style="text-align: center;">
<td>
<input type="checkbox" id="Monday" data-day="1" name="Monday" value="1" class="big-checkbox" />
<label for="Monday">Mon</label>
</td>
<td>
<input type="checkbox" id="Tuesday" data-day="2" name="Tuesday" value="2" class="big-checkbox" />
<label for="Tuesday">Tues</label>
</td>
<td>
<input type="checkbox" id="Wednesday" data-day="3" name="Wednesday" value="3" class="big-checkbox" />
<label for="Wednesday">Wed</label>
</td>
<td>
<input type="checkbox" id="Thursday" data-day="4" name="Thursday" value="4" class="big-checkbox" />
<label for="Thursday">Thur</label>
</td>
<td>
<input type="checkbox" id="Friday" data-day="5" name="Friday" value="5" class="big-checkbox" />
<label for="Friday">Fri</label>
</td>
</tr>
</tbody>
</table>