How to Enable AJAX for Gravity Forms
If you’re using Gravity Forms, you’ve probably noticed there isn’t a simple global setting to enable AJAX for your forms (which honestly would be a nice built-in option). Without AJAX enabled, forms trigger a full page refresh on submission.
Adding the snippet below forces AJAX on for every Gravity form site-wide, allowing submissions to process without reloading the page and keeping confirmation messages and validation errors dynamic.
If you only want it enabled on specific forms instead, you’ll need to use the Gravity Forms shortcode and pass ajax="true" as a parameter.
add_filter( 'gform_form_args', function( $args ) {
$args['ajax'] = true;
return $args;
} );All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
We recommend Code Snippets (100% Free) or WPCode (sponsored)
Related Snippets