ok, after testing this myself i found a few issues... here is the
revised changes/line numbers
209: errorElement: "label",
ADDED 210: errorElementClass: "",
211: focusInvalid: true,
450: errors: function() {
ADDED 451: var errorElementClassToUse =
this.settings.errorElementClass.length > 1 ?
this.settings.errorElementClass : this.settings.errorClass;
CHANGED 452: return $( this.settings.errorElement + "." +
errorElementClassToUse , this.errorContext );
453: },
616: // refresh error/success class
CHANGED 617: label.removeClass().addClass
( this.settings.errorElementClass.length>1?
this.settings.errorElementClass : this.settings.errorClass );
618:
619:// check if we have a generated label, replace the message then
620: label.attr("generated") && label.html(message);
621:} else {
622:// create label
623:label = $("<" + this.settings.errorElement + "/>")
624:.attr({"for": this.idOrName(element), generated: true})
CHANGED 625:.addClass(this.settings.errorElementClass.length>1?
this.settings.errorElementClass : this.settings.errorClass)
626:.html(message || "");
627:if ( this.settings.wrapper ) {
i have posted the revised jquery.validate.js here:
http://pastebay.com/41589
here is an example usage:
$("#myform").validate({
errorElementClass:"someClass",
errorClass: "anotherClass"
})
again, let me know what i need to do to help get this commited.
thanks
On Aug 21, 12:41 pm, IT <[email protected]> wrote:
> 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---