Hey, my validation form works just fine but i've a problem with
changing the class at a successful validation.

My Code:
success: function(label) {
        label.addClass('success').text("Ok!")
},
errorPlacement: function(error, element) {
        error.appendTo( element.parent("td").next("td") );
},
highlight: function(element, errorClass) {
        $(element.form).find("label[for=" + element.name + "]").addClass
(errorClass);
},
unhighlight: function(element, errorClass) {
        $(element.form).find("label[for=" + element.name + "]").removeClass
(errorClass);
}

I want that the class "error" will be removed and that the class
"success" will be added. But, when I do this, The script doesn't
recognize the 'label'-element anymore. How can I fix this properly?
For now, I changed the following:
errors: function() {
        return $( this.settings.errorElement + "." +
this.settings.errorClass, this.errorContext );
},
into:
errors: function() {
        return $( this.settings.errorElement, this.errorContext );
},

Greetings,
Tim

Reply via email to