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.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist