aspose file tools *
The moose likes Servlets and the fly likes Deleting multiple row using checkbox Using Servlet and Jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Deleting multiple row using checkbox Using Servlet and Jsp" Watch "Deleting multiple row using checkbox Using Servlet and Jsp" New topic
Author

Deleting multiple row using checkbox Using Servlet and Jsp

Chirag dave
Greenhorn

Joined: Mar 11, 2014
Posts: 3

out.println("</select>");
out.println("<link rel='stylesheet' type='text/css' href='css/table.css'/>");
out.println("<input type='text' id='searchText'/>");
out.println("<input type='hidden' id='hide' value='" + selected + "'/>");

out.println("<input type='button' value='Search' onclick='getData()'/>");
out.println("<br/><br/>");
out.println("<input type='button' id='edit' value='Edit' onclick='edit(" + row + ", " + column + ")'/>");
out.println("<input type='button' id='save' value='Save' onclick='save(" + row + ", " + column + ")'/>");
out.println("<table border='1' class='table'>");
out.println("<tr>")

out.println("<td>");
out.println("<input type='checkbox' id='chkbox' name='chkbox'/>");
out.println("</td>");
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
out.println("<td>" + rsmd.getColumnName(i) + "</td>");

}
out.println("</tr>");
while (rs.next()) {
out.println("<tr>");
out.println("<td>");
out.println("<input type='checkbox' id='chkbox' name='chkbox'/>");
out.println("</td>");
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
out.println("<td><input id='" + tr + "_" + i + "' type='text' value='" + rs.getString(i) + "' disabled/></td>");
}
tr++;
out.println("</tr>");
}
out.println("</table>");
tr = 0;
} catch (Exception ex) {
out.println(ex.toString());
} finally {
out.close();
}
}


what i want is ..on selecting heading check box...all the below check box should get selected....and clicking on delete button which i will create later on...i want multiple rows to be deleted from database

please refer image


[Thumbnail for gold.PNG]

Surendra Kumar
Ranch Hand

Joined: Jul 04, 2006
Posts: 235
This has to be done using JavaScript on client side.
Please google for it and you can find a lot of code examples.
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 530
    
    2

1 ) Please use code tags.

2) Prefer rendering the page using jsp or relative technology rather than using servlet to print.

3) As another poster suggested, you will basically need to send the details of what needs to be deleted from client using form get/post , ajax etc etc as HTTP request to servlet for the job ( delegate the actual deletion to DAO).

What did you do so far, apart from printing the page ?


Regards
KumarRaja

Chirag dave
Greenhorn

Joined: Mar 11, 2014
Posts: 3


what i want is ..on selecting heading check box...all the below check box should get selected....and clicking on delete button which i will create later on...i want multiple rows to be deleted from database

please refer image
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deleting multiple row using checkbox Using Servlet and Jsp