Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q597 How can I direct the browser to a custom thank you page after the form is submitted?

You are here: irt.org | FAQ | JavaScript | Form | 7.3 | Q597 [ previous next ]

The easiest way is with a cgi script on the server, failing that you can use a frameset with a hidden frame:

<frameset cols="100%,*">
<frame src="formpage.htm" name="formpage">
<frame src="scriptpage.htm" name="scriptpage">
</frameset>

and then in the form page:

<form onSubmit="parent.scriptpage.go()">
...
<input type="submit">
</form>

And then in the script page:

<script language="JavaScript"><!--
function go() {
    setTimer('now()',5000); // delay of five seconds
}

function now() {
    parent.location.href = 'thankyou.htm';
}
//--></script>

©2018 Martin Webb