Multiple Form Issue

Multiple Form Issue

Hey,

When I have one form on a page, I can grab the id of the submit button and process it with the following code:

  $('#sresbtn1').click(function () {
   
... code

}

sresbtn1 = the id of the submit button.

But what happens if I have multiple forms generated from db results and dynamically name each submit button differently, such as sresbtn1 for form #1 and sresbtn2 for form 2 etc... --> all the way to 10+ forms per page.

How would jquery allow me to recognize which button was submitted. Should I offer a prefix naming method such as
sresbtn_1 for form #1 and sresbtn_2 for form 2? If so, how do I replace:

    $('#sresbtn1').click(function () {

with a line that recognizes the dynamic selected button? Since I can't predict it, do I need something like this:

$("div[id^=prefix_]") ??

(I saw it on google groups?)

What is the syntax to solve this issue? Thank you.