devxlogo

How to Handle Multiple SUBMIT Buttons in HTML Forms

How to Handle Multiple SUBMIT Buttons in HTML Forms

If you have to handle a form with multiple SUBMIT buttons on it, you can find which button was clicked by looking at the button’s value attribute in the Request.Form collection. The button has a value only if it was the one pressed. For example:

 

Here ASP code logic should check Request.Form(“cmdButtonA”) against an empty string. If the value in cmdButtonA is not an empty string, Button A was pressed. A similar check happens with cmdButtonB.

devx-admin

Share the Post: