jQuery Validation request
|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
jQuery Validation requestHi, I was working with validation, but am having problems using the method "max" for maximal numbers. I live in Holland and for us the decimal character is a comma, and I can use comma's for validating the max value of a field. Could someone please make an addon like "numberDE" for max? So i can check comma's. Thanks! Richard |
|
|
Re: jQuery Validation requestHi Richard,
I also live in the Netherlands and ran into the same problem. I couldn't find an answer online so i decided to write some addon methods myself. I added the following two methods to the validator and that did the trick. $.validator.addMethod("maxNL", function(value, element, param) { var val = value.replace(",", "."); return this.optional(element) || val <= param; }, jQuery.validator.format("Vul hier een waarde in kleiner dan of gelijk aan {0}.")); $.validator.addMethod("minNL", function(value, element, param) { var val = value.replace(",", "."); return this.optional(element) || val >= param; }, jQuery.validator.format("Vul hier een waarde in groter dan of gelijk aan {0}.")); It doesn't do much more than replace a comma with a period and validate the new value. Hope this helps. Note that this probably doesn't work for numbers greater than 1000 with formatting (for example, 1.000,00). In that case you have to switch the period for a comma and the comma for a period. Greets, Bart
|
|
|
Re: jQuery Validation requestHi all
Who can tell me how to unsubscribe this mailling list? I'm gonna use another account for this mailing list. thanks
|
|
|
Re: jQuery Validation requestThe following instructions are paraphrased from: You can unsubscribe from a group through the web interface or via email. To unsubscribe through the web interface, just click the "Edit my membership" link on the right-hand side of the group's homepage at http://groups.google.com/group/jquery-en/. Then click the "Unsubscribe" button on the page that appears. To unsubscribe via email, send an email to jquery-en+unsubscribe@... --Karl ____________ Karl Swedberg On Nov 4, 2009, at 12:07 AM, NathanHuang wrote: Hi all |
| Free embeddable forum powered by Nabble | Forum Help |