i am using a jsp page in which i am trying to show all emailID from database and with every emailID a delete button attached to it like-
<table border=0>
<%
while(rs.next())
{
%>
<tr>
<td><h3><font color="blue"><b><%=rs.getString("emailID") %>
</b>
</font></h3></td>
<td width="70%"></td>
<td><h3
><input type="submit" value="delete"></h3></td>
</tr>
<%
}
%>
</table>
in ResultSet i have emailID. I want to implement a code that can delete an emailID whenever its corresponding delete button is been clicked.The problem what i am facing is that i am not able to differentiate between different buttons.On what basis should i compare two buttons that will perform different functions.As the buttons are dynamically created how can i delete a particular record with particular button.The already given answer is only for one button while i am dealing for many of them. Please specify some correct code. Thanks