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

Q647 When submitting a form, how do I load a thank you page when the user presses the submit button?

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

You'll need a frameset with a hidden page:

<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
function startTimer() {
    setTimer('sayThanks()',5000); // say thankyou after 5 seconds
}

function sayThanks() {
    top.location.href = 'thankyou.htm';
}
//--></SCRIPT>
</HEAD>

<FRAMESET ROWS="100%,*">
<FRAME SRC="page_with_form.htm">
<FRAME SRC="about:blank"> <!-- or blank.htm, which contains nothing -->
</FRAMESET>

Then alter your form so that it does:

<FORM onSubmit="parent.startTimer()">

©2018 Martin Webb