Reputation: 6110
I have used HTML in my new project and seems pretty nice to use some of the new features. However there is a few things that are iffy and I can get them to work. For example if I use pattern
attribute for my field validation error message isn't showing in all browsers. I read few blogs but all of them are too old and I'm not sure which of these problems are fixed. Here is my example:
<input type="text" name="frm_field1" id="frm_field1" style="width:50px" pattern="^/d{1,3}$" title="Numeric values up to 3 digits." x-moz-errormessage="Numeric values up to 3 digits allowed." />
The code above will output the error message in Firefox but won't output anything in Chrome, Safari, and IE. I'm wondering if this problem can be fixed some how?
So far I couldn't get this error message to show in all browsers. My field is not required and validation is triggered only if value is in the field. If anyone knows the way to fix this problem please let me know.
Upvotes: 0
Views: 167
Reputation: 514
You can also preferably try using javascript to validate your form instead.
Upvotes: 0
Reputation:
It's because you're using a prefix specific to firefox x-moz-errormessage
There is no equivalent thing for webkit (chrome) but you might want to look at setCustomValidity
Upvotes: 2