简体   繁体   English

用于数字验证的 jquery 验证 HTML 标记

[英]jquery validation HTML tag for number validation

How can I create a numeric HTML attribute to use on my form properties?如何创建用于表单属性的数字 HTML 属性? The attribute needs to be validated with JQuery Validation.该属性需要使用 JQuery 验证进行验证。

The number from that field needs to be an integer.该字段中的数字必须是整数。

If it already exists, how can I use it?如果它已经存在,我该如何使用它?

If not, I can use some already existent implementations.如果没有,我可以使用一些已经存在的实现。 But I'm pretty sure there has to be one.但我很确定必须有一个。

I've found the answer.我找到了答案。

When I tried to use it, I tried as this code says:当我尝试使用它时,我尝试过,因为这段代码是这样说的:

<input type="text" number/>

The problem is that the number attribute must have a value and it must be set to true:问题是 number 属性必须有一个值,并且必须设置为 true:

<input type="text" number="true"/>

Now it works.现在它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM