Disable HTML5 Validation

Disable HTML5 validation on your Gravity Forms

Read the Walkthrough

Code

Filename: gw-disable-html5-validation.php

<?php
/**
 * Gravity Wiz // Gravity Forms // Disable HTML5 Validation
 * https://gravitywiz.com/disable-html5-validation-on-gravity-forms/
 *
 * An easy way to disable HTML5 validation on your Gravity Forms.
 *
 * Plugin Name:  Gravity Forms Disable HTML5 Validation
 * Plugin URI:   https://gravitywiz.com/disable-html5-validation-on-gravity-forms/
 * Description:  Disable HTML5 validation on your Gravity Forms
 * Author:       Gravity Wiz
 * Version:      0.1
 * Author URI:   https://gravitywiz.com/
 */
add_filter( 'gform_form_tag', 'add_no_validate_attribute_to_form_tag' );
function add_no_validate_attribute_to_form_tag( $form_tag ) {
	return str_replace( '>', ' novalidate="novalidate">', $form_tag );
}

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.