Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the powerful-docs domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/spectra-qa-sites/webapps/sureforms-staging-qa/wp-includes/functions.php on line 6131

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the convertpro-addon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/spectra-qa-sites/webapps/sureforms-staging-qa/wp-includes/functions.php on line 6131

Notice: Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.) in /home/spectra-qa-sites/webapps/sureforms-staging-qa/wp-includes/functions.php on line 6131
srfm_on_trigger_form_submission - SureForms
|
/ Documentation /Developer Documentation/JS Custom Events/ srfm_on_trigger_form_submission

srfm_on_trigger_form_submission

Description:

This event is triggered just before the form submission process begins. It allows external scripts to intercept and potentially modify or cancel the submission process. Calling event.preventDefault() stops the submission flow and prevents the loader from being displayed.

Parameters:

    • form: The form element that is being submitted.
    • loader: The loader element associated with the form, which will be activated during submission.
    • formId: The unique identifier for the form being submitted.
    • submitType: The type of form submission (e.g., “same page”, “different page”, “custom URL”).
    • successElement: The element intended to display the success message after submission.
    • successContainer: The container that wraps the success message element.

    Event Implementation:

       const event = new CustomEvent( 'srfm_on_trigger_form_submission', {
              cancelable: true,
              detail: {
                form,
                loader,
                formId,
                submitType,
                successElement,
                successContainer,
              },
            } );
    
        if ( ! document.dispatchEvent( event ) ) {
            loader.classList.remove( 'srfm-active' );
            return; // Stop further execution if event.preventDefault() was called.
          }
    Was this doc helpful?
    What went wrong?

    We don't respond to the article feedback, we use it to improve our support content.

    Need help? Contact Support
    On this page
    Scroll to Top