我正在使用validate.js。
var v = $("#form1").validate({
ignore: ':hidden',
rules: {
txtName: { required: true },
txtTitle: { required: true }
txtInterval:{///Only allow integer}
},
messages: {
txtName: "<br/>Please enter a Name",
txtTitle: "<br/>Please enter a Title",
txtInterval:"<br/>Please Enter a Integer"
}
});
代码工作正常我想验证txtInterval
只允许整数值,但不知道如何通过validate.js.Show me a correct way.
感谢。
答案 0 :(得分:1)
$("#myform").validate({
rules: {
field: {
required: true,
number: true
}
}
});