Alon Shmiel
Alon Shmiel

Reputation: 7121

get unchecked box

I have a form of a table with 'checkbox':

  out.print("<table><tr>");
  String box_user = null;
  out.print("<td>");
  box_user = "<input name = 'check' value=r" + id + " type='checkbox'>";
  out.print(box_user);
  out.print("</td>");
  out.print("</tr></table>");

I got all the checked box by:

String[] str;
str = request.getParameterValues("check");

now, I want to get all the unchecked box. how can I get it?

Upvotes: 1

Views: 285

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168825

..get all the unchecked box..

You put the check boxes in there so you must know what they are. To find out which ones are not checked, iterate the collection of all check boxes & if unchecked, add them to a second collection.

Upvotes: 1

Related Questions