$('#delete').click(function (e) {
e.preventDefault();
var result = true;
if($('.checkbox:checked').length < 1) {
$.notifyBar({
cls: "error",
html: 'At least 1 checkbox must be checked.',
delay: 5000
});
result = false;
}
return result;
});
the problem is button doesn’t submit form if all goes well
Is there any wrong?
The call to
e.preventDefault()is preventing the default action of the button which is to submit the form. You need to only call that when you don’t want a submit to occur.