JavaScript

Articles

gform.state

The gform.state object in Gravity Forms is a utility for managing form state, including storing data, registering callbacks, and observing state changes

gform.tools

The gform.tools object is a toolkit that includes functions for tasks like debouncing events, manipulating DOM elements, handling cookies, and managing events.

gform.utils

The gform.utils object in Gravity Forms provides a collection of utility functions and modules to assist developers in performing common tasks such as DOM manipulation, data processing, browser compatibility, etc.

gform.adminUtils

The gform.adminUtils object provides utility functions commonly used in the WordPress admin. These utilities can help handle unsaved changes warnings and extract query parameters from the URL.

gform/conditionalLogic/applyRules/start

The gform/conditionalLogic/applyRules/start event allows you to run custom logic right before conditional rules are applied. It’s useful for prepping UI changes, showing loaders, or managing field state in conversational forms.

gform/conditionalLogic/applyRules/end

The gform/conditionalLogic/applyRules/end event allows you to react after conditional logic is applied. Use it to trigger animations, restore inputs, or handle field visibility updates in conversational forms.

gform/post_render

The gform/post_render event can be used to initialize scripts when a form loads. It is a direct replacement for gform_post_render.

gform/theme/scripts_loaded

The gform/theme/scripts_loaded event can be used to initialize scripts that depend on Gravity Forms front-end form scripts, including the JavaScript gform object.

gform/submission/pre_submission

The gform/submission/pre_submission filter should be used to perform custom actions between a form button (e.g. submit, next, previous) being clicked and the request being posted to the server.

gform/ajax/post_ajax_submission

This filter allows developers to customize or modify the response data, including additional information, custom messages, or altered submission details.