Skip to content

Instantly share code, notes, and snippets.

View Striffly's full-sized avatar

Clément Gayot Striffly

View GitHub Profile
@Striffly
Striffly / README.md
Last active July 3, 2024 15:35
Gravity Forms with AJAX, conditional logic, pages transitions (compatible with Barba.js, Taxi.js, Highway.js, ...)

The following code enables the use of Gravity Forms (2.8.7 as of now) with the following features:

  • AJAX loading, 100% functional
  • Functional with page transitions (Barba.js, Taxi.js, Highway.js)
  • Enqueue Gravity Forms scripts used by each forms (including conditional logic scripts)
  • Works with recaptcha (with recent version of Gravity Forms reCAPTCHA Add-On, scripts are automaticaly enqueued)
  • Keep the form displayed after submission (optional)
  • Scripts moved to footer (optional)

The code was initially integrated into projects using roots/sage. I adapted the code for integration into "vanilla" WordPress projects but I have less feedback compared to the use I have with my stack, so feel free to let me know if there are any errors in the comments!