|
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()">
|
|
|
Copyright © 1996-2009 irt.org, All Rights Reserved.