Submit from Any Page

Allow submission of a form from any page by adding a “Submit Now” button to each page. This can be particularly useful when editing an existing entry and wanting to allow the user to submit those edits from whichever page they’ve edited.

Instructions

  1. Install this snippet with our free Custom JavaScript plugin. https://gravitywiz.com/gravity-forms-code-chest/

Code

Filename: gw-submit-from-any-page.js

/**
 * Gravity Wiz // Gravity Forms // Submit from Any Page
 * https://gravitywiz.com/
 *
 * Allow submission of a form from any page by adding a "Submit Now" button to each page.
 * This can be particularly useful when editing an existing entry and wanting to allow the
 * user to submit those edits from whichever page they've edited.
 *
 * Instructions:
 *
 * 1. Install this snippet with our free Custom JavaScript plugin.
 *    https://gravitywiz.com/gravity-forms-code-chest/
 */
$( '.gform_next_button' ).each( function() {
	var fieldId = gf_get_input_id_by_html_id( $( this ).attr( 'id' ) );
	$( this ).after( '<input type="button" id="gform_submit_button_GFFORMID_' + fieldId + '" class="gform_submit_button button" value="Submit Now" onclick="jQuery(\'#gform_target_page_number_GFFORMID\').val(\'0\');  jQuery(\'#gform_GFFORMID\').trigger(\'submit\',[true]); " onkeypress="if( event.keyCode == 13 ){ jQuery(\'#gform_target_page_number_GFFORMID\').val(\'0\');  jQuery(\'#gform_GFFORMID\').trigger(\'submit\',[true]); } ">' );
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.