Description
The gform_post_set_field_property JavaScript action hook enables custom actions to be performed when a field property is set in the form editor.
Usage
The filter which would run for all forms and fields would be used like so:
gform.addAction( 'gform_post_set_field_property', function ( name, field, value, previousValue ) {
// Do something.
} );
Parameters
namestring
The name of the property that was set.fieldobject
The field object that was updated.valuestring|integer|float|boolean|array
The current value of the specified property.previousValuestring|integer|float|boolean|array
The previous value of the specified property.
Examples
gform.addAction( 'gform_post_set_field_property', function ( name, field, value, previousValue ) {
console.log( 'doing gform_post_set_field_property:' );
console.log( arguments );
} );
Placement
Reference the article Adding JavaScript Code to the Admin Side of Your Site.
Since
This hook was added in Gravity Forms v2.7.16
Source Code
This hook is located in SetFieldProperty() in form_editor.js.