Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change the error class name on jQuery validate?

I want to change the class that jQuery Validate applies to inputs that have an error

Change this

<input id="firstname" name="firstname" type="text" value="" maxlength="100"
class="error">

to this

<input id="firstname" name="firstname" type="text" value="" maxlength="100" 
class="customErrorClass">
like image 577
FarFigNewton Avatar asked May 11 '11 14:05

FarFigNewton


1 Answers

Try specifying the errorClass property:

$('.selector').validate({
    errorClass: 'customErrorClass',
    rules: { ... },
    messages: { ... }
});
like image 87
Darin Dimitrov Avatar answered Sep 19 '22 19:09

Darin Dimitrov