Alright this problem has been driving me a little crazy.
I have a checkbox on my form that looks like this:
<%=Html.CheckBox("Agreement", false)%>Yes, I agree to the terms
And then I have a js file that is loaded into the browser after jquery and jquery.validate are loaded that looks like this:
$.validator.setDefaults({
submitHandler: function() { alert("submitted!"); }
});
$().ready(function() {
// validate signup form on keyup and submit
$("#campForm").validate({
rules: {
Agreement: "required"
},
messages: {
Agreement: "Please accept our policy"
}
});
});
So reading the documentation this should work but it never does. What am I doing wrong?