TWO Submit Buttons in 1 Form

Results 1 to 3 of 3

Thread: TWO Submit Buttons in 1 Form

  1. #1
    rrt Guest

    Default TWO Submit Buttons in 1 Form

    Is it possible to have two Submit buttons in the same form? I would like one Submit buttom to go to one page and the other in another page.<BR><BR>Thank You.

  2. #2
    J Guest

    Default RE: TWO Submit Buttons in 1 Form

    no only one submit per form, however...<BR>use the "button" control<BR>&lt;input type="button" name="cmdPage1" value="Goto Page 1" onclick="javascript: document.location.href=&#039;page1.asp&#039;"&gt;< BR><BR>if you need to submit the page - for server side processing - you will have to call a javascript function in the onclick event to do this

  3. #3
    Join Date
    Dec 1969

    Default RE: TWO Submit Buttons in 1 Form

    You could give this a try.<BR><BR>Above your &#060;html&#062; tag put this:<BR><BR>&#060;script ID="clientEventHandlersJS" LANGUAGE="javascript"&#062;<BR>&#060;/script&#062;<BR><BR>&#060;script language="VBSCRIPT"&#062;<BR><BR>sub form1()<BR>frmname1.submit<BR>end sub<BR><BR>sub form2()<BR>frmname2.submit<BR>end sub<BR><BR>&#060;/script&#062;<BR><BR>Now make sure your submit buttons have the onclick() tag:<BR><BR>&#060;INPUT type="submit" value="Submit" id=submit1 name=submit1 onclick="form1()"&#062;<BR><BR>&#060;INPUT type="submit" value="Submit2" id=submit2 name=submit2 onclick="form2()"&#062;<BR><BR>Now you need to put your two forms somewhere on the page, I find it easier to put them right at the bottom. Each form will take you to another page:<BR><BR>&#060;form method="post" action="yourpage1here" id="frmname1" name="frmname1"&#062;<BR>&#060;/form&#062;<BR><BR>&#060;form method="post" action="yourpage2here" id="frmname2" name="frmname2"&#062;<BR>&#060;/form&#062;<BR><BR>Idea being you click on submit button 1 which goes to top of page and calls sub form1() which in turn tells it to look for the form named frmname1 and then submit it.<BR><BR>Works for me, and seems to not cause any problems. You can pass over hidden variables and other things too.<BR><BR>The javascript will work just as well as this, but giving you an alternative.<BR><BR>*W

Posting Permissions

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