Here is my simple verification code for testing:
jQuery.validator.addMethod("oneTypeChecked", function (value, element) {
return false;
}, "Check one or more type");
$("#RequestCreateForm").validate({
rules: {
ChkBoxType1: { oneTypeChecked: true }
}
});
But my oneTypeChecked method is never called when I submit the form. Why?
Here is my HTML code:
<div class="editor-field">
<input type="checkbox" id="ChkBoxType2" name="requestTypeIds2" value="2">Type 2
<input type="checkbox" id="ChkBoxType1" name="requestTypeIds1" value="1">Type 1
<input type="checkbox" id="ChkBoxType3" name="requestTypeIds3" value="3">Type 3
</div>
Many thanks!
Tuizi source
share