faqts : Computers : Programming : Languages : JavaScript : Forms

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

21 of 51 people (41%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How do I send the user to a thankyou.html page after on onSubmit form validate

Aug 28th, 2000 07:24
Martin Honnen, Mike Scott,


Usually you don't use a thank you page after validation but after form 
submission. And then you simply make the FORM ACTION the thank you page 
e.g.
  <FORM ACTION="processFormDataAndReturnThankYouPage">
If you really want to have a thank you page after form submission then 
open up a window and document.write one:
  var w = open('about:blank', 'thankYouWin',
               'width=300,height=300,resizable=1,scrollbars=1');
  var html = '';
  html += '<HTML><BODY>'
        + '<H1>Thank you for your correct form entries.<\/H1>'
        + 'Your form is now submitted.'
        + '<\/BODY><\/HTML>';
  w.document.open();
  w.document.write(html);
  w.document.close();
  setTimeout('w.close()', 5000)