Form Tools
getting thankyou result out of frame - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: getting thankyou result out of frame (/showthread.php?tid=1153)



getting thankyou result out of frame - 2x4 - Mar 29th, 2011

Case:
A long form is in an iframe (sized for the actual form pixel size). Once submitted, it pulls in the thankyou.php, where two-liner text is displayed (Success blah blah).
The problem is that the submitter may not see it (too up on the page).
The form is submitted via API.

Solution:
Make the result break out of iframe-- e.g. target = top.

How:
Open api.php

Find:

Code:
header("location: $next_page");

Hack:
Code:
//header("location: $next_page");

echo("<script language=\"javascript\">top.location.href = \"$next_page\"</script>;");



RE: getting thankyou result out of frame - Ben - May 12th, 2011

Hi 2x4,

Sorry for never getting to this! Interesting one... with POST forms it's easy: just add the target="_parent" to the form that posts to your success page. But with the API, you're already operating within the iframe and the request has already been made.

I don't know! I'm actually not sure it's possible! One option would be to output nothing but some JS which calls a function in the parent page to show the success message. Or, you could go with what you have. But I can't think of a non-JS solution.

- Ben