Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | JavaScript | Form 7.3 | Q647 [ previous next ]

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

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()">

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.