Disable HTML5 Validation on Gravity Forms
An easy way to disable HTML5 validation on your Gravity Forms.
Why we created this snippet?
There are a number of reasons why you might be looking for a snippet like this. We wrote the snippet originally after encountering an issue with a form not submitting if a user entered an incorrect email, even after correcting the mistake. There was a conflict between Gravity Forms preventing double submissions and the browser based support of HTML5 validation. Our fix was to disable HTML5 validation and rely on the Gravity Forms validation.
How do I get started?
- This will work with even Gravity Forms v1.0 but that’s no excuse not to be running the latest version.
- Already have a license? Download Latest Gravity Forms
- Need a license? Buy Gravity Forms
- Copy and paste the snippet into your theme’s functions.php file.
- Once you have installed the snippet, you’re good to go! This one’s plug and play.
For greater control over the attributes on the form tag, make sure to check out our Gravity Forms Tag Editor plugin.
If you use it and like it, let us know!
Hi, This snippet still valid? as its not working as disabling html5 output in gravity form setting Eg. if we are editing an entry , then the validation prohibiting again. but disabling html5 in settings then its work as expected.
Hi,
When testing locally, this seems to be working. If you’re a Gravity Perks customer, drop us a line and we’ll look into it.
Best,
Just wanted to thank you for this post – although we didn’t use this snippet, it did push in the right direction to enabling the “Output HTML5” setting for our form. Much appreciated!
Glad to help, Chris!
Is there a benefit using this instead of ‘disable html5 output’ in the Gravity Forms settings?
It will have the same effect but disabling HTML5 also disables ALL HTML5 features, not just the HTML5 validation.
welp, this broke my site. It wasn’t clear that only part of it needed to be in the functions.php file. I mistakenly added all of it to the existing code. -__-
Hi Rob, it sounds like you’ve already got this fixed but if not, this will help: https://gravitywiz.com/documentation/snippet-troubleshooting/
Perfect little snippet! Thanks for this easy fix.
Glad you found it useful!
Where do i direct pre sale questions?
Hi Jermain,
There is a link on the Gravity Perks sales page to the pre sales form but for easy access, here you go! Question about Gravity Perks?