Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

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:

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

function sayThanks() {
    top.location.href = 'thankyou.htm';

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

Then alter your form so that it does:

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

©2018 Martin Webb