Ajax Gravity Forms ✦ Free & Best

However, it would be dishonest to review this feature without addressing the elephant in the room:

Let's walk through a basic example: submitting a form and, upon success, redirecting to a URL (something the built-in AJAX cannot do). ajax gravity forms

Google's reCAPTCHA expects a normal form submission in many configurations. When using AJAX, you must ensure the reCAPTCHA token is included in your AJAX data and that you initialize reCAPTCHA on the new content if the form is dynamically loaded. However, it would be dishonest to review this

$.ajax({ url: my_ajax_obj.ajax_url, type: 'POST', data: formData, beforeSend: function() { $form.find('input[type="submit"]').prop('disabled', true).val('Submitting...'); }, success: function(response) { if (response.success) { // Custom success behavior: Redirect! window.location.href = response.data.redirect_url; } else { // Display validation errors (Gravity Forms sends back HTML) $form.find('.gform_validation_errors').remove(); // Clear old errors $form.prepend(response.data.validation_html); $form.find('input[type="submit"]').prop('disabled', false).val('Submit'); } }, error: function() { alert('An error occurred. Please try again.'); $form.find('input[type="submit"]').prop('disabled', false).val('Submit'); } }); }); You can enable it using one of three

AJAX is disabled by default for new forms. You can enable it using one of three primary methods:

This custom approach gives you complete control. You can close modal popups, play success sounds, trigger analytics events, or animate a custom thank-you message—all without ever leaving the page.

Gravity Forms’ implementation of AJAX solves this by turning the form submission into a background process.