Form Submit Buttons

Results 1 to 3 of 3

Thread: Form Submit Buttons

  1. #1
    Join Date
    Dec 1969

    Default Form Submit Buttons

    How is the variable of which of multiple different submit buttons was pressed sent to the next page? <BR>eg:<BR>&#060;INPUT TYPE=SUBMIT NAME="one" VALUE="Save and Submit"&#062;<BR>&#060;INPUT TYPE=SUBMIT NAME="two" VALUE="Save Only"&#062;<BR><BR>if this was placed in a form using GET and sending the variables to an ASP page, how can I retrieve which submit button was pressed, or is it not possible?<BR>

  2. #2
    sm549 Guest

    Default RE: Form Submit Buttons

    If a button is pressed and has a name its value will be in the request. Keep in mind that if they hit return in a form entry field, a submit can happen without a button click. You can do something like this to determine the button pressed:<BR><BR>If Trim(Request.Form("one")) &#060;&#062; "" Then<BR>&nbsp&nbsp&#039Button one pressed<BR>ElseIf Trim(Request.Form("two")) &#060;&#062; "" Then<BR>&nbsp&nbsp&#039Button two pressed<BR>End If<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Form Submit Buttons

    If you give them both the same name (say "Submit") you can check the value of that field in the Request.Form collection and figure out which was pressed.<BR><BR>Dunc

Posting Permissions

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