Extend jquery plugin to check negative numbers
-
23-08-2019 - |
Question
I use a jquery validation plugin and I need to add some extra checking, but I can't edit the main file. How I can do this?
Solution
You can add your own validation methods with addMethod function
OTHER TIPS
yes i get the solution just taking this i got the solution ,, greaterThanZero is the class name of field to be checked
jQuery.validator.addMethod("greaterThanZero", function(value, element) { console.log(element); return this.optional(element) || /^\d*.{0,1}\d+$/.test(value); }, "* Amount must be greater than zero");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow