I'm having an issue with Chrome (could be all webkit, only tried Chrome for the time being) with HTML5 form validation. in the <form> tag I have the "novalidation" attribute set, but Chrome not only is not letting me submit a form, but it's keeping data from being viewed; not populated, but viewed. I made a fiddle to show the issue.
https://dotnetfiddle.net/zIMk99
The particular fiddle is using MVC, but from what I can tell, that had no impact on my testing. My actual website is Webforms .NET 4.5 and I got the same result.
If on the <input> box I put type="number" (to bring up the number pad for my social security field on mobile devices) and I allow dashes in my SSN field, Chrome will not let me submit the form. When anything accesses the "value" it returns empty string. If I remove the type="number", it goes back to working fine.
I've tried this in IE11 and both the type="number" and type="text" work as expected; as does my actual validation I put in the page.
Here are the steps to replicate:
- Go to my fiddle: https://dotnetfiddle.net/zIMk99
- When it loads, do an inspect element on the textbox.
- You should see value="123-12-1234" for the input field
- You will see the field is blank.
- If you set the text to "123121234", it will allow it to continue.
- My regex does allow for dashes and spaces and does work appropriately when type="tel" or type="text" (tel because it allows dashes).
Any other information you need, please let me know. I hope it's just an oversight on my part.