Good call. My fix looks slightly different, but should work just as well. You can get the latest revision here: http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/jquery.validate.js Or wait for the 1.5.2 release.
Jörn On Thu, Feb 19, 2009 at 11:43 AM, rami <rami.p.salmi...@gmail.com> wrote: > > > When maxlength is set for textarea and the field is validated, the > plugin seems to consider line breaks within the textarea as two > characters at least in IE and Opera. That is because in IE and Opera, > the textarea string received with element.value contains line breaks > represented with two characters \r\n. With Firefox, this problem does > not occur. > > As improvement suggestion, could this line in code: > > var result = $.validator.methods[method].call( this, element.value, > element, rule.parameters ); > be changed to use jQuery element value: > var result = $.validator.methods[method].call( this, $(element).val(), > element, rule.parameters ); > > That $(element).val(), replaces all the \r\n with \n so that a line > break results as one character in validation. > > At least I did not find any option to fix this. Tested with validation > plugin 1.5.1. > > Br. > Rami >