我有 jquery.validate.js 插件,它对我来说工作得很好。
我的问题是:
我有一个文本框,这个文本框是强制性的,应该只接受数字。
在js中,我可以看到有数字验证,问题是我不知道如何使用它。
我只知道如何通过放入文本框字段
来创建必填字段
那么,如何添加一个验证标准以仅接受数字。
谢谢
I am having the jquery.validate.js plugin and it is working fine for me.
My question is :
I am having a textbox and this textbox is mandatory and should only accept digits.
In the js, I can see that there is validation for the digits and the problem is that I do not know how to use it.
I only knew how to make the field required by putting in the textbox field <class="required">
So, how can I add one more validation criteria to accept only digits.
Thanx
发布评论
评论(2)
要检查它,请添加
http://docs.jquery.com/Plugins/Validation/Methods/digits
to check it add
http://docs.jquery.com/Plugins/Validation/Methods/digits