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.
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.
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.
You can also find more settings information in the documentation section of this site.
Kevin,
Is it possible to force the redirect page into a new window?
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.
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.
Interesting. I'll kick around a few ideas and see what I can come up with.
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.
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.
Worked super Kevin. Thanks again.
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