multiple targets to post one form

Results 1 to 2 of 2

Thread: multiple targets to post one form

  1. #1
    Shashank Pabrai Guest

    Default multiple targets to post one form

    Hi!<BR>I have one form where I want to have two submit buttons. If user clicks on say, button1 then the form data should get posted to page1.asp and if the user clicks on button2 then form data should get posted to page2.asp Any suggestions on how to do this?<BR><BR>The form ACTION= allows only one target!!<BR>Thanks. :)

  2. #2
    Mark T. Guest

    Default RE: multiple targets to post one form

    Your best bet is to use JavaScript. Give your FORM a NAME like you would an INPUT tag (I.E. &#060;FORM NAME="MyForm" ...>). Then, use the ONCLICK Event Handler to change the Forms Action property.<BR><BR>For Example:<BR><BR>&#060;FORM NAME="MyForm" METHOD="POST" ACTION="foo.asp"><BR>&#060;INPUT TYPE="SUBMIT" NAME="SUBMIT1" onclick="document.MyForm.action = \"Page1.asp\""><BR>&#060;INPUT TYPE="SUBMIT" NAME="SUBMIT2" onclick="document.MyForm.action = \"Page2.asp\""><BR>&#060;/FORM>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •