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?

49 of 72 people (68%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

Can I submit a form to two different locations?

Aug 21st, 2000 08:47
Martin Honnen, Maureen Strong,


HTML is not allowing more than one TARGET attribute so all you can try 
with JavaScript is to submit twice while changing the target:
  <FORM NAME="formName"
        TARGET="window1Name"
        ACTION="whatever.html"
  >
  // first submission
  document.formName.submit();
  // delayed second submission to let the first succeed
  function submit2 () {
    document.formName.target = 'window2Name';
    document.formName.submit();
  }
  setTimeout('submit2()', 2000);