I created a custom rule
$(document).ready(function(){
$("#test-form").validate({
rules: {
test1:{
required: true,
minlength: 2
}
},
messages: {
test1:{
required: "required",
minlength: "min 2"
}
}
});
// don't really process form
$("#test-form").submit(function() { return false; });
and I have this HTML code
<input type="text" class="test1"/>
however it doesn't work
if I change to predefined rule , it works
<input type="text" class="number"/>
Validate()uses thename=attribute from yourinput, but you don't have one. Add aname="test1"attribute.