PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Redirect to page after submission

  1. Kevin Geary
    Member

    I can't for the life of me figure out how to redirect the user to a "thank you" or "payment" page after submission. Please help.

    Posted 14 years ago on Wednesday November 18, 2009 | Permalink
  2. If you're editing the form, open up the form settings panel at the top, and click on the "confirmation" tab. You'll see the options to redirect to a page, etc. there.

    Screenshot

    Screenshot 2

    You can also find more settings information in the documentation section of this site.

    http://www.gravityhelp.com/documentation/form-settings/

    Posted 14 years ago on Wednesday November 18, 2009 | Permalink
  3. Kevin,

    Is it possible to force the redirect page into a new window?

    Posted 14 years ago on Thursday November 19, 2009 | Permalink
  4. Scott, not that I know of. I'm not really sure why you'd need to though.

    You could do something like this.. redirect the form back to the same page passing a variable in the query string like "confirm=true". Use some PHP to check for the variable and if it's present, use a javascript window.open function to open a confirmation page in a new window.

    The down side to doing it this way is that it's basically a popup window that's launched automatically and most popup blockers are going to tag it.

    There may be some other work arounds, but that's really the first thing that came to mind.

    Posted 14 years ago on Thursday November 19, 2009 | Permalink
  5. Kevin,

    I have two specific examples where this would be handy for me.

    I was wanting to create a form that submits the current page to facebook to share. I had basically a blank form with just a submit button and two hidden fields that passed the URL and title to Facebook. I just didn't want people leaving my site to do it.

    Second. I have a site that has some CSS tabs, where most of the time only one tab is visible. After submitting a form in the tabs, it displays the confirmation text in the tab that is no longer visible, and sends people back to the main tab.

    Posted 14 years ago on Thursday November 19, 2009 | Permalink
  6. Interesting. I'll kick around a few ideas and see what I can come up with.

    Posted 14 years ago on Thursday November 19, 2009 | Permalink
  7. Scott you could always try something like this on those forms.. basically it's setting a target="blank" attribute on the form itself.

    <script type="text/javascript">
    	jQuery(document).ready(function() {
     		jQuery("#gform_XX").attr("target", "_blank");
    	});
     </script>

    where "gform_XX" is the actual ID of your form of course.

    It worked okay in my test. You can see my screenshot of the form when inspected with firebug. The jQuery is writing the attribute in properly.

    I'm not going to say it's the most elegant solution, but it should get the job done in a pinch.

    Posted 14 years ago on Thursday November 19, 2009 | Permalink
  8. Kevin,

    That worked! Thank you sir! Suggest that a check box be put into the back end for the future to force opening in a new window.

    Posted 14 years ago on Thursday November 19, 2009 | Permalink
  9. Worked super Kevin. Thanks again.

    Posted 14 years ago on Thursday November 19, 2009 | Permalink
  10. travin
    Member

    Kevin,

    How do I use your code above to make my form redirct to a new page? I don't know how to change the attribute of my form.

    Thanks in advance

    Posted 13 years ago on Thursday March 3, 2011 | Permalink

This topic has been resolved and has been closed to new replies.