Disable Submit During Upload

Use this snippet alongside our free Gravity Forms Custom JavaScript plugin to disable the submit button while files are being uploaded.

Instructions

Code

Filename: gpfup-disable-submit-during-upload.js

/**
 * Gravity Perks // File Upload Pro // Disable Submit During Upload
 * https://gravitywiz.com/documentation/gravity-forms-file-upload-pro/
 *
 * Instruction Video: https://www.loom.com/share/e35cf2da108b4064b3b33ea5d65ed021
 *
 * Use this snippet alongside our free [Gravity Forms Custom JavaScript][1] plugin to disable
 * the submit button while files are being uploaded.
 *
 * [1]: https://gravitywiz.com/gravity-forms-code-chest/
 */
gform.addAction( 'gpfup_uploader_ready', function( gpfup ) {
	gpfup.Uploader.bind( 'UploadFile', function() {
		$( '.gform_button' ).prop( 'disabled', true );
	} );
	gpfup.Uploader.bind( 'UploadComplete', function() {
		$( '.gform_button' ).prop( 'disabled', false );
	} );
} );

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.