Dear Morris,
Please try the following.
Add the below mentioned code in Forms > Form Options > Javascript
section
$(document).ready(function(){
var limit = 3;
$('input[type=checkbox]').on('change', function(evt) {
console.log($("input[type='checkbox']:checked").length);
if($("input[type='checkbox']:checked").length > limit) {
this.checked = false;
}
});
})
Please try and provide the feedback.
Thanks, have a nice day!
Hi, the code above doesn’t work, please find below link and code location whether is correct not :
https://kaawei.co.uk/diy-cookies/
View post on imgur.com
Thanks.
Hi Morris,
Sorry for the inconvinence. Please try to add this code.
jQuery(document).ready(function(){
var limit = 3;
jQuery('#9form_view1 input[type=checkbox]').on('change', function(evt) {
console.log($("#9form_view1 input[type='checkbox']:checked").length);
if($("#9form_view1 input[type='checkbox']:checked").length > limit) {
this.checked = false;
}
});
})
Thanks, have a nice day!