Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Active Server Pages (ASP)
Expertise: Beginner
Oct 21, 1999



Application Security Testing: An Integral Part of DevOps

Determine Which Submit Button Was Clicked

I have a Web page with a form(action=sample.asp),frmProduct. The form has some textboxes (one of which is a key field, sav txtKey) and two submit buttons: one for retrieve (btnRetrieve) and one for delete (btnDelete). In sample.asp, how do I find out which button was clicked?


Name all the buttons on your form with the same name "CMD". They obviously have different VALUEs—the caption on the button. Then, in your sample.asp page, you can find out which button was pressed and accordingly take action:

Select Case Trim(Request("CMD"))
   Case "Retrieve"
      ...retrieval code
   Case "Delete"
      ...deletion code
End Select
DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date