devxlogo

Using Multiple Submit Buttons with Select Case

It is common to have a Web page that calls itself. On this page, you may want to have many buttons that will each produce a different call. An example is a page that allows you to navigate, add, edit, or delete a record/recordset. You can accomplish this by appending special commands to the URL, exposing some implementation details. However, it is also possible to do this through a Post method. When a form has multiple submit buttons all with the same name, the value of the button will be returned via a Post method. You can then use this value to determine your action.

 


<%Select Case Request.Form("SUBMIT") Case "Move First" Response.Write "

Do Move First" Case "Move Previous" Response.Write "

Do Move Previous" Case "Move Next" Response.Write "

Do Move Next" Case "Move Last" Response.Write "

Do Move Last" Case "Add" Response.Write "

Do Add" Case "Edit" Response.Write "

Do Edit" Case "Delete" Response.Write "

Do Delete" Case Else Response.Write "

Invalid Action"End Select%>

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Seven Service Boundary Mistakes That Create Technical Debt

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.