Extending Integrated Forms - Post Success Actions

Sometimes you need to do some extra action on the page after the submission of a form from a 3rd party plugin. Often each has its own methods.

One side benefit of using Popup Maker v1.9+ is that it includes all of that logic for you and we pass it all through a single hook which can be used to detect AJAX & non AJAX based form submissions in JavaScript reliably.

/**
 * This hook fires after any integrated form is submitted successfully.
 *
 * It does not matter if the form is in a popup or not.
 *
 * @since 1.9.0
 *
 * @param {Object} form JavaScript DOM node or jQuery object for the form submitted
 * @param {Object} args {
 *     @type {string} formProvider Such as `gravityforms` or `ninjaforms`
 *     @type {string|int} formId Usually an integer ID number such as 1
 *     @type {int} formInstanceId Not all form plugins support this.
 *     @type {string} formKey Concatenation of provider, ID & Instance ID.
 *     @type {int} popupId The ID of the popup the form was in.
 *     @type {Object} popup Usable jQuery object for the popup.
 * }
 */
PUM.hooks.addAction('pum.integration.form.success', function (form, args) {
	// Do something useful here.
});
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.