カスタムルールを作成しました
$(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; });
そして私はこのHTMLコードを持っています
<input type="text" class="test1"/>
しかし、それは機能しません
定義済みのルールに変更すると、機能します
<input type="text" class="number"/>