Allows you to auto-submit a form when the page loads, with a 1/2 second delay. Full tutorial here: https://gravityranger.com/auto-submit-form-page-load/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* GravityRanger Auto-Submit Form on Page Load | |
* | |
* Allows you to auto-submit a form when the page loads, with a 1/2 second delay. | |
* https://gravityranger.com/auto-submit-form-page-load/ | |
* | |
* @instructions: | |
* | |
* 1. Change gform_ID# to your forms ID number (line 24) | |
* 2. Set the amount of time you'd like to delay the script (line 27) | |
* 3. Add the scipt to an HTML field within your form | |
* | |
* @version 1.0 | |
* @author GravityRanger | |
* @license GPL-2.0+ | |
* @link http://gravityranger.com/ | |
* | |
* | |
*/ | |
<script type="text/javascript"> | |
setTimeout(function(){ | |
jQuery(document).ready(function(){ | |
jQuery('form#gform_ID#').trigger('submit'); //change ID to your forms ID# number | |
}); | |
}, 500); //seconds before submit (1000 = 1 second) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment