I want to show JavaScript alert when user trying to choose more than four values from the group of checkbox the checkbox names are in array
<div class="checkbox alert alert-primary">
<p><input type="checkbox" id="calorieCheckbox" name="txt_tradesman[]" value="<?php echo $restrad['tradesman_id'] ?>" onClick="return KeepCount()"><?php echo $restrad['fullname'] ?> <p>
</div>
Here's jQuery version:
$('[name="txt_tradesman[]"]:checked').length
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.