开发者

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

开发者 https://www.devze.com 2023-03-29 14:19 出处:网络
I am looking for help regarding to jquery validation plugin.I am using number option to accept only numbers like bellow

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

精彩评论

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