JavaScript

Articles

gform.config

The gform.config object provides utility functions for retrieving, updating, and validating forms configuration settings in JavaScript. It includes methods for working with both local and AJAX loaded configuration data.

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.submission

The gform.submission object provides functions for managing form submissions with JavaScript. It includes methods for submitting a form, detecting the submission method, and preventing duplicate submissions.

gform JavaScript Object

This page lists the available functions and objects, along with their types. Developers can use this as a reference when working with the Gravity Forms JavaScript API.

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.