Skip to content

Instantly share code, notes, and snippets.

@chrisegg
Last active December 20, 2021 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisegg/1618874380d71285d685e1a73cde53cd to your computer and use it in GitHub Desktop.
Save chrisegg/1618874380d71285d685e1a73cde53cd to your computer and use it in GitHub Desktop.
Use this code snippet if you'd like to display a text confirmation before redirecting the user to another page/url with Gravity Forms.
/**
* GravityRanger
* https://gravityranger.com/display-text-confirmation-before-redirecting-gravity-forms/
*
* Used to display a text message after a form is submitted, but triggers a redirect 2 seconds after message is displayed.
*
* Instructions: Copy and paste lines 11-17 into a Gravity Forms text confirmaton. Make any necessary changes to the text or number of seconds, i.e 2000 = 2 seconds, (line 16).
*
*/
Thank you for your submission. Please stand by, something exciting is about to happen...
<script type="text/javascript">
setTimeout(function() {
window.location = 'https://yourdomain.com/thank-you/';
}, 2000); // 2 seconds
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment