Hi everybody,
On my website I use a ChronoForm which can be reached from multiple pages. So I was looking a way to get back to the calling page, once the form submitted. I couldn't find a suitable trick to do this this forums or elsewhere on the web, so I post my solution here (it's a hack from the 'Thank you' page question on the FAQ).
First, I add this line to the HTML code of my form :
This add to the form a hidden field called "refere" and taking the form callin page url as value.
Then, I type these lines to the On Submit code - after sending email ;
This uses the "referer" fields posted with form to redirect the user to the parent page. Don't forget to leave empty the "Redirect URL:" field in "Form URLs" tab to be sure this trick acts as expected.
Hope this may help.
On my website I use a ChronoForm which can be reached from multiple pages. So I was looking a way to get back to the calling page, once the form submitted. I couldn't find a suitable trick to do this this forums or elsewhere on the web, so I post my solution here (it's a hack from the 'Thank you' page question on the FAQ).
First, I add this line to the HTML code of my form :
<input type="hidden" name="referer" value="<?php echo $_SERVER["HTTP_REFERER"];?>" />This add to the form a hidden field called "refere" and taking the form callin page url as value.
Then, I type these lines to the On Submit code - after sending email ;
<?php
global $mainframe;
$referer = $_POST['referer'];
$custom_tag = '<meta http-equiv="refresh" content="5; url='.$referer.'>';
$mainframe->addCustomHeadTag($custom_tag);
?>
<p>Your message has been sent.</p>
<p>You'll now be redirected to the parent page. If the redirection doesn't work automatically, please click <a href="<?php echo $referer ?>">here</a></p>.This uses the "referer" fields posted with form to redirect the user to the parent page. Don't forget to leave empty the "Redirect URL:" field in "Form URLs" tab to be sure this trick acts as expected.
Hope this may help.
Thanks for posting this useful hack!🙂
Regards,
Max
Regards,
Max
Hi everybody,
On my website I use a ChronoForm which can be reached from multiple pages. So I was looking a way to get back to the calling page, once the form submitted. I couldn't find a suitable trick to do this this forums or elsewhere on the web, so I post my solution here (it's a hack from the 'Thank you' page question on the FAQ).
First, I add this line to the HTML code of my form :
<input type="hidden" name="referer" value="<?php echo $_SERVER["HTTP_REFERER"];?>" />This add to the form a hidden field called "refere" and taking the form callin page url as value.
Then, I type these lines to the On Submit code - after sending email ;
<?php
global $mainframe;
$referer = $_POST['referer'];
$custom_tag = '<meta http-equiv="refresh" content="5; url='.$referer.'>';
$mainframe->addCustomHeadTag($custom_tag);
?>
<p>Your message has been sent.</p>
<p>You'll now be redirected to the parent page. If the redirection doesn't work automatically, please click <a href="<?php echo $referer ?>">here</a></p>.This uses the "referer" fields posted with form to redirect the user to the parent page. Don't forget to leave empty the "Redirect URL:" field in "Form URLs" tab to be sure this trick acts as expected.
Hope this may help.
This works great. Does anyone know how to make this work for users that have the Chrome Browser? Seems not to work.
Thanks
I updated the version in this FAQ recently. Have you tried that?
I tried it. What I got was the page starting to redirect, but then tossing an error:
The requested URL /<site url>/index.php; charset=utf-8 was not found on this server.By the way, the URL is not what was entered in the text of the meta refresh. I used the full qualified site name, or absolute, URL.
Hi GardinerJ,
There's a Joomla! bug. See this thread on the Joomla! forums where you'll find my bug fix and - probably more useful - a workaround from Skitalec.
Bob
There's a Joomla! bug. See this thread on the Joomla! forums where you'll find my bug fix and - probably more useful - a workaround from Skitalec.
Bob
This topic is locked and no more replies can be posted.
