Your code don't solve my problem, but I believe that I found the problem.
The problem is the label class. When I set the errorClass, the label still
have the class='error'.
$(form).validate({
focusInvalid: false,
event: blur,
debug: true,
errorClass: comErro,
errorPlacement: function(error, id)
Can I suggest something?
Instead of making for example:
messages:{
fieldName: {
required: blabla
}
}
To use a standard for all the messages:
messages:{
required: blabla
}
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
Leonardo K schrieb:
Your code don't solve my problem, but I believe that I found the problem.
The problem is the label class. When I set the errorClass, the label
still have the class='error'.
$(form).validate({
focusInvalid: false,
event: blur,
debug: true,
errorClass: comErro,
Leonardo K schrieb:
Can I suggest something?
Instead of making for example:
messages:{
fieldName: {
required: blabla
}
}
To use a standard for all the messages:
messages:{
required: blabla
}
You can override default messages by modifying the
jQuery.validator.messages object. So in
Jorn,
I'm still having problems to display error messages in a css class. Using
Leonardo's suggestion:
errorClass: msgerro,
errorPlacement: function(error, id) {
error.attr(class, msgerro);
error.appendTo( element.next() );
nothing else, your validation error messages
should be red!
Rick
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Web Specialist
Sent: Thursday, March 08, 2007 8:42 PM
To: jQuery Discussion.
Subject: Re: [jQuery] Problem with validation
Jorn,
I'm still having problems to display error
Whenever plugin validates the field it creates new label with error
JS:
$(form).validate({
focusInvalid: false,
event: blur,
debug: true,
errorPlacement: function(error, id) {
error.appendTo( $(id).next() );
}
});
HTML:
li class=
label for=titulo Títulospan class=req * /span/ label
div
Whenever plugin validates the field it creates new label with error
JS:
$(form).validate({
focusInvalid: false,
event: blur,
debug: true,
errorPlacement: function(error, id) {
error.appendTo( $(id).next() );
}
});
HTML:
li class=label for=tituloTítulospan class=req * /span/label
div
input
Leonardo K schrieb:
Whenever plugin validates the field it creates new label with error
I forgot to update the example about errorPlacement, d'oh. Try this:
errorPlacement: function(error, element) {
error.appendTo( element.next() );
}
I tried your example here, and it works.
If the above