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 );
} );
} );
Thanks for the suggestions. Unfortunately this wouldn’t accomplish what I attempting to do. I would need to disable the submit button entirely. Appreciate your reply though!
Hi Aaron,
You can try out this modified version of the snippet, it will also disable the submit button while no files has been selected.
Alternatively, you can check out this snippet, it will disable the submit button until all Required fields are filled out.
Cheers,
Is there a way to disable the submit button entirely until files are uploaded? Basically making file upload pro conditional so the user must upload files to submit the form?
Hi Aaron,
You could make the File Upload field required by ticking the “Required” option in General Settings. This won’t disable the Submit button, but it will force a user to add a file to successfully complete the form.
Best,