I'm developing a servlet that either displays info or saves info, depending on the flag passed. When displaying the info from the Access2000 db, I have a checkbox displaying the value from the "approved" column in my db. In the db, if the value is 'Yes', the box is checked, and if 'No', then it's not. This works for me fine.
But, I would like the user to be able to check/uncheck the "approved" checkbox on the html page that the servlet developed and then be able to save whatever changes she made in the db.
Here's how I enable the checkbox to be checked/unchecked from the db:
String approved = "";
String myyes = "Yes";
approved = rs.getString("approved");
out.println("<td width=\"98\"><input type=\"checkbox\" name=\"chkapproved\" value=\"ON\" checked></td>");
out.println("<td width=\"98\"><input type=\"checkbox\" name=\"chkapproved\" value=\"OFF\"></td>");
I hope this is clear!