tomeraz
tomeraz

Reputation: 323

What is the proper way to change the default email validation error message?

Using parsley.js, what is the proper way to change the email error validation message from "This value should be a valid email." to "That's not a valid email. Check again?"

Couldn't find a simple way in the docs, examples or online.

Thanks!

Upvotes: 0

Views: 455

Answers (1)

Murtuza Z
Murtuza Z

Reputation: 6007

You can add custom message in the html element itself.

<input type="email" class="form-control" name="email" data-parsley-trigger="change" data-parsley-error-message="YOUR CUSTOM ERROR MESSAGE HERE" required="">

Sample usage:

enter image description here

Refer: Online Documentation

Upvotes: 3

Related Questions