Kevin
Kevin

Reputation: 567

parsley error message class override

I'm using parsley.js with bootstrap, and I'm trying to change the class for their error messages (according to their documentation) but it doesn't seem to be working. No error messages, but no changes either.

The JS is here:

$('#userForm').parsley({ successClass: 'alert alert-success', errorClass: 'alert alert-error' });

And the form is basically just:

<form class="form-horizontal" id="userForm" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" data-validate="parsley" data-focus="first">
<input type="text"id="firstName" name="firstName" placeholder="" class="input-xlarge" data-trigger="change" data-required="true">
<input class="btn btn-primary btn-success" type="submit" name="submit" id="newUserSubmit" value="Sign In">
</form>

Upvotes: 1

Views: 3323

Answers (1)

Ethan Kawkji
Ethan Kawkji

Reputation: 227

Try removing data-validate="parsley" from the form tag, as I see on their documentation the following :

Warning : you must remove data-validate="parsley" auto-binding code in your forms DOM to allow you to override the default processing and use Parsley purely from javascript.

And things should work.

Upvotes: 2

Related Questions