I have the following form: https://expogr.com/bankexpokenya/advertise.php
I am filling the details of the form and clicking on the submit button. If I have not checked one checkbox, it gives me a message saying "please select any one checkbox" along with the ok button.
After clicking the ok button, the form is getting submitted. For form submission, I have used email method so the form data is sent to the particular emailids.
I have tried the following code:
$(document).ready(function(){
$("form").submit(function(){
if ($('input:checkbox').filter(':checked').length < 1){
alert("Please select at least one option from above!");
break;
return false;
}
});
});
But its not working.
$(document).ready(function(){
$("form").submit(function(){
if ($('input:checkbox').filter(':checked').length < 1){
alert("Please select at least one option from above!");
break;
return false;
}
});
});
breakdoes nothing except inside a loop, so it shouldn't be there. Thereturn falseshould be working though.break;doesn't do anything. It should be removed.