gform_form_saving_filter_EVENT

Description

This dynamic JavaScript filter hook is used to filter event arguments when a form is saved via AJAX in the form editor.

Usage

The filter which runs for all would be used like so:

gform.addFilter( 'gform_form_saving_filter_' + event_name , function( ...args, event, form ) {
    //do something
}, 10, 2 );

Parameters

Events

  • …args
    One or more additional arguments passed for the current event.
  • event Javascript Object
    The current event object.
  • form Javascript Object
    The form currently being saved.

The following events can be used with this dynamic hook:

Event…argsDescription
save_beganApplies before the save process starts, but after the save button has been clicked or the save shortcut has been triggered.
save_abortedApplies if the form failed validation after the save process has started.
save_in_progressoptionsApplies just before the save request is sent, and after the form object has been validated. Once this action is fired the UI enters a loading state.
save_request_failedresponseApplies if the request failed due to a network error.
save_failedresponseDataApplies if saving the form failed.
save_succeededresponseApplies if saving the form was successful.
save_completedApplies once the save request is completed. This event is always triggered – even if the request failed.
script_before_reloadNewScriptElement
scriptElementID
currentScriptElement
Applies just before a script tag is being replaced.
script_after_reloadNewScriptElement
scriptElementID
replacedScriptElement
Applies just after the script tag has been replaced.
element_before_reloadnewElement
elementID
currentElement
Applies just before an element is being replaced.
element_after_reloadnewElement
elementID
replacedElement
Applies after an element has been replaced.
before_field_setting_addednewSettingElementApplies just before a new field setting is added.
after_field_setting_addednewSettingElementApplies just after a new field setting has been added.
before_field_setting_deletedsettingElementApplies just before a field setting element is deleted.
after_field_setting_deletedsettingElementApplies just after a field setting element has been deleted.
before_field_setting_updatecurrentSettingElement
newSettingElement
Applies just before a setting element that has the data-js-reload attribute is replaced.
after_field_setting_updatesettingElementApplies just after a setting element that has the data-js-reload attribute has been replaced.

Note: Events related to scripts and elements require that the data-js-reload attribute be present on those elements in the form editor. All elements (i.e. script tags, fields, and field settings) in the form editor that have the data-js-reload attribute will be replaced after a successful save. By default, field settings don’t have the data-js-reload attribute, if you want your field setting to be always replaced with the new markup, you have to add the data-js-reload attribute to its markup.

Since

This action hook was added in Gravity Forms 2.6

Source Code

This action is located in FormSaverEventsManager.trigger() in /assets/js/src/admin/save-form/form-saver-events-manager.js