Forums

Redirecting after Thank You Message in Chrome

evetsnalon 25 Oct, 2012
Has anyone been able to figure out how to redirect after the Thank You page for Chrome Users.. I have a couple of methods that work fine for the other browsers, but for Chrome it will not.

Thanks,🙂
GreyHead 25 Oct, 2012
Hi evetsnalon,

What have you tried that isn't working?

Bob
evetsnalon 26 Oct, 2012

Hi evetsnalon,

What have you tried that isn't working?

Bob



Well, so far I have used about everything that I can think of. I put this together to cover all browser types and so far it is working on all but the Chrome. Scratching my head because this should be working. I have put this in the Thank You Html, but it strips too much code as usual. But If I insert this in the PHP Code After Email and again it works for all others but Chrome....HMMMmmmm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="TestJoomlaAddress.html" />
<title>Test Timed Redirection</title>
<noscript>
<meta http-equiv="refresh" content="5; URL=TestJoomlaAddress.html">
</noscript>
<script language="JavaScript">
<!--

var sTargetURL = "TestJoomlaAddress.html";

function doRedirect()
{
    setTimeout( "timedRedirect()", 5*1000 );
}

//  There are three definitions of 'timedRedirect', this
//  one adds to the visitors page history.
function timedRedirect()
{
    window.location.href = sTargetURL;
}

//-->
</script>

<script language="JavaScript1.1">
<!--

function timedRedirect()
{
    window.location.replace( sTargetURL );
}

//-->
</script>

<script language="JavaScript">
<!--
// This should redirect Chrome Browsers
function timedRedirect()
{
	window.setTimeout("location=( sTargetURL );",5000);
}
//-->
</script>

</head>

<body onload="doRedirect()">

<p><em><strong><span style="color: #3366ff; font-size: large;">Thank You For Your Entry!</span></strong></em><br /><br /><em><strong><span style="color: #3366ff; font-size: large;">Good Luck!</span></strong></em></p>

<p>Loading <a href="TestJoomlaAddress.html">Candle GiveAway</a></p>
<p>In approx. 5 seconds the redirection target page should load.<br>
If it doesn't please select the link above, or navigate by menu above or whatever you like. Thanks Again.</p>

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      </body>

</html>


If you have any thoughts, that would be grand sir....🙂
evetsnalon 26 Oct, 2012
Oh well, as usual I have attempted to make it much harder than it needs to be. So, I just put whatever text I wanted in the Thank You Message and then placed a simple meta refresh in the PHP code, after Email as follows.....🙂

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="5;URL='/TestJoomlaAddress.html'" />
</head>
</html>


Works like a charm.. Sorry for taking your valuable time.

Thanks.............
GreyHead 26 Oct, 2012
Hi evetsnalon,

The Joomla! equivalent is
<?php
$doc =& JFactory::getDocument();
$doc->setMetaData('refresh', '10;URL='.$form->data['redirect_url'].'', 'true');
?>
where the URL was previously set in a ReDirect URL action or in the form data.

Bob
Sue 28 Feb, 2013
Is there a way to do this in the form wizard? I have the Thank you message displaying correctly, I just need to figure out how to add the timer and redirect to the Home page.
GreyHead 28 Feb, 2013
Hi Sue,

In the Forms Wizard you can drag in a Custom Code action. In the Easy Wizard you can use one of the Custom PHP Code boxes on the Others tab.

Please see this FAQ for a workaround for a Joomla! bug that you may meet.

Bob
Sue 28 Feb, 2013
Perfect! I had to use the one to avoid the Joomla bug, but it works like a charm. Thanks for the quick reply
This topic is locked and no more replies can be posted.