Custom error message for field of type 'email' not working
See original GitHub issueHi,
I’m currently integrating Parsley for a site, and am having a problem setting a custom error message for an email field. I also have a ‘required’ constraint on this field, with an accompanying error message, and that works, but when the email address is not valid I’m seeing the default “This value should be a valid email.” error message rather than the one I’ve set. My field looks like this:
<input class="form-control" data-parsley-required data-parsley-type="email" data-parsley-required-message="email address required" data-parsley-email-message="must be a valid email address" name="email" type="text" id="email">
Many thanks -
Issue Analytics
- State:
- Created 9 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top Results From Across the Web
HTML5 form required attribute. Set custom validation message?
Here is the code to handle custom error message in HTML5: <input type="text" id="username" required placeholder="Enter Name" oninvalid="this.
Read more >Providing custom error messages for built-in HTML5 form ...
How to customize built-in form validation error messages · Grab the input element(s) with a querySelector / querySelectorAll . · Add an event ......
Read more >How To Create A Custom Email Validation Error Message
Want to know how to create custom email validation error messages? We provide an outline with code snippets that you can use as...
Read more >Client-side form validation - Learn web development | MDN
A field is invalid if it has a value and that value has fewer characters than the minlength value or more than the...
Read more >Showing custom validation error in HTML5 - Tech Funda
As we all know that there is no uniformity in the form element validation messages comes in different browsers. To make these error...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try using
data-parsley-type-message="must be a valid email address"
instead please.I’ve been tripped by this too. The documentation at http://parsleyjs.org/doc/index.html#ui-for-field
is a bit confusing here.