[validate] new option for validate() (code included)

[validate] new option for validate() (code included)


i think this belongs in the bug tracker, but wanted to post here first
for thoughts...
While using the validator i ran into some confusion in trying to set a
separate style (class) to the the invalid element and its label.
There are some complicated ways of setting this defined within the
documentation using the highlight option... but its not as easy as it
could be for something seemingly common.
to make things easier, i have added an additional option to the
validator method called "errorElementClass". IF this option is set,
when the label is rendered, the class attribute of the label is set
to"errorElementClass", if errorElementClass is not set, the existing
option "errorClass" is applied. Because errorClass is used if
errorElementClass is not set, this change is backwards compatible with
existing code.
this only takes two changes within the latest version of
jquery.validate.js here are the affected line numbers:
209: errorElement: "label",
ADDED 210: errorElementClass: "error",
211: focusInvalid: true,
623: .attr({"for": this.idOrName(element), generated: true})
CHANGED 624: .addClass(this.settings.errorElementClass.length >1 ?
this.settings.errorElementClass : this.settings.errorClass )
625: .html(message || "");
does this make sense? or is this redundant with some other
functionality i am unaware of? if this change makes sense, let me
know how best to go about getting it incorporated into the next
release.
Thanks