943,712 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Marked Solved
  • Views: 1381
  • ASP RSS
Mar 27th, 2009
0

multiple submit buttons

Expand Post »
hi !
how can i use multiple submit buttons in the same form

i want to pass form values to different pages depending on which of the two submit button is clicked...
thank's
Similar Threads
Reputation Points: 10
Solved Threads: 9
Junior Poster
aashishn86 is offline Offline
184 posts
since Jun 2008
Mar 28th, 2009
0

Re: multiple submit buttons

you will need to probably use javascript for that..

alternatively... give your submit buttons diferent values and retrieve them on a "splitter" page..

request("sumbit1") etc
Reputation Points: 10
Solved Threads: 2
Junior Poster
william_stam is offline Offline
131 posts
since Mar 2005
Mar 30th, 2009
0

Re: multiple submit buttons

ya........ found a javascript code...

ASP Syntax (Toggle Plain Text)
  1. <SCRIPT language="JavaScript">
  2. function OnSubmitForm()
  3. {
  4. if(document.pressed == 'Insert')
  5. {
  6. document.myform.action ="insert.html";
  7. }
  8. else
  9. if(document.pressed == 'Update')
  10. {
  11. document.myform.action ="update.html";
  12. }
  13. return true;
  14. }
  15. </SCRIPT>
  16.  
  17.  
  18. <FORM name="myform" onSubmit="return OnSubmitForm();">
  19.  
  20. <INPUT TYPE="SUBMIT" name="Operation" onClick="document.pressed=this.value" VALUE="Insert">
  21.  
  22. <INPUT TYPE="SUBMIT" name="Operation" onClick="document.pressed=this.value" VALUE="Update">
  23.  
  24. </FORM>
Reputation Points: 10
Solved Threads: 9
Junior Poster
aashishn86 is offline Offline
184 posts
since Jun 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: ASP make an image out of a pdf document
Next Thread in ASP Forum Timeline: Server side development





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC