onChange()
This event handler runs when a field value is changed.
Last updated
Was this helpful?
This event handler runs when a field value is changed.
Last updated
Was this helpful?
This is a prop and callback function to run custom logic when a field value is changed. It's called every time the user changes one or multiple field values. This function can be asynchronous.
You can use onChange
to log or update form state when the user modifies it. It takes a single object that provides form-related state and handlers.
Consistently available form state and functions
integrationData
optional object
Third-party metadata may be passed back through this property. If trigger
equals addressSelect
, this object returns the Google Places address ID (id
), the components of its address, and the latitude / longitude of the address.
trigger
Info of the element that triggered the field value change.
valueRepeatIndex
integer
Specifies which item (0-indexed) in the field value changed if there are multiple items. If an item was removed, the index will be -1.
integrationData
DefinitiontriggerData
Definitionid
string
The ID of the field that changed.
type
enum {field, addressSelect}
repeatIndex
integer
If the element whose value changed repeats, this specifies which repetition it is. This value is 0-indexed and equals 0 if the element doesn't repeat.
If trigger
equals addressSelect
, this change event was triggered by the user selecting an dropdown option. In that case, integrationData
contains the address's Google Places address ID (id
), its individual components, and the latitude / longitude.
What triggered the field value change. Either a form field was modified or an autocomplete option was selected.