Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with required input on IE #19

Closed
whgibbo opened this issue Jul 21, 2014 · 1 comment
Closed

Problems with required input on IE #19

whgibbo opened this issue Jul 21, 2014 · 1 comment

Comments

@whgibbo
Copy link

whgibbo commented Jul 21, 2014

Hi,
I've been using Html5Forms.js for a while, good work :)

I have recently stubble over a problem with a required field. I have take the example test patternRequired.html and made the following change from :

 <input type="text" name="fullName" value="" required="required" />

to:

<input type="text" name="fullName" value="" required="required" oninvalid="this.setCustomValidity('blah2');" onvalid="this.setCustomValidity('');/>

as I wanted to change the message that was being displayed depending on the language of the user.

Now if you load the page on IE8 (or IE 12 but in IE8) mode and don't enter anything and press enter. You will see the 'blah2' appear on the full name field. :)

Now enter some text into the fullname input and press enter again. It now always displays the blah message and the only way to get rid of the message is to reload the page. :(

Any ideas ?

Thanks

@zoltan-dulac
Copy link
Owner

@whgibbo Sorry for the late response. I'll be looking into these issues on github a lot more closely than I have of late.

It is better to use the data-errormessage attribute to set custom messages, like:

<input type="text" name="fullName" value="" required="required" data-errormessage="Please enter your name to continue" />

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants