Thanks again to Jorn for a fantastic plugin. One thing I noticed, with the
additional-methods.js file that is included with the download, is a small
error with the messages for the maxWords, minWords, and rangeWords methods.
They are missing $.format():
jQuery.validator.addMethod("maxWords", function(value, element, params) {
    return this.optional(element) || value.match(/\b\w+\b/g).length <
params;
}, $.format("Please enter {0} words or less."));

jQuery.validator.addMethod("minWords", function(value, element, params) {
    return this.optional(element) || value.match(/\b\w+\b/g).length >=
params;
}, $.format("Please enter at least {0} words."));

jQuery.validator.addMethod("rangeWords", function(value, element, params) {
    return this.optional(element) || value.match(/\b\w+\b/g).length >=
params[0] && value.match(/bw+b/g).length < params[1];
}, $.format("Please enter between {0} and {1} words."));

-- 
Steve "Cutter" Blades
Adobe Certified Professional
Advanced Macromedia ColdFusion MX 7 Developer
_____________________________
http://blog.cutterscrossing.com
---------------
Co-Author 'Learning Ext JS'
http://www.packtpub.com/learning-ext-js/book

Reply via email to