Jörn,

I'm using your jQuery Validation plugin for an ASP.NET site. Because
ASP.NET dynamically generates unfriendly form element names (e.g.,
ctl00$ContentPlaceHolderBody$uxPhoneNumber) I have been replacing the
"name" attribute when the page loads with something more friendly
(e.g., phoneNumber) so that I can use these names in the validation
code (and also so that I only have to hard code ASP.NET id values in
my JavaScript file, instead of both id and name attribute values).

I do the name replacement before calling Validate() on the form.

However, I discovered that this throws an error in IE 7 on fields that
do remote validation and are invalidated. I couldn't figure out the
problem, but it had to do with a name attribute lookup in
jquery.validation.js, and the lookup returning null. This does not
occur for local validation on the same field (e.g., required or
minlength), nor does it occur when the remote validation is true.

All other browsers (Opera 9, FF 3.0, Safari, etc.) showed no errors.
It's only IE 7 (and probably IE 6).

Swapping out the ASP.NET TextBox control with an HTML input field set
to the friendly name I want resolved the issue in IE. So it has
something to do with the name attribute replacement. Very odd.

Patrick

Reply via email to