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

Reply via email to