Introduction
The gform.state
object in Gravity Forms is a utility for managing form state, including storing data, registering callbacks, and observing state changes.
Overview
Method | Parameters | Returns | Description |
---|---|---|---|
callbacks | None | Object | Stores callback functions for state changes, keyed by form or field IDs (e.g., {678: Array(1)}). |
data | None | Object | Stores state data for forms or fields, keyed by IDs (e.g., {678: Array(0)}). |
get() | Object|String | Any | Retrieves the state value for a specified form or field. |
set() | Object|String|Any | Undefined | Updates the state value for a specified form or field. |
watch() | Object|String|Function | Undefined | Registers a callback to observe state changes for a form or field. |