开发者

jQuery Validation plugin not accepting float value started with .(dot)

I am looking for help regarding to jquery validation plugin. I am using number option to accept only numbers like bellow

$("#myform").validate({ rules: { field: { required: true, number: true } } });

it allows 1, 0.9, 1.5 and etc. which is good but it doesn't allow .9 .How can i make it acc开发者_StackOverflowept even its started with dot.

There is example

Thanks in advance


To do that, you'll likely have to change the source of the plugin. Why don't you simply ensure that the form data is in the proper format? Bind a function to the blur event for input fields which appends a preceding 0 to the value, if necessary.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜