This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSP and the fly likes Select only checkboxes matching criteria Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Select only checkboxes matching criteria" Watch "Select only checkboxes matching criteria" New topic
Author

Select only checkboxes matching criteria

sharon hugo
Greenhorn

Joined: Apr 12, 2005
Posts: 5
(New to this stuff) I have three possibilities of selection using checkboxes, Select All Active, Select All Inactive, and individual checkbox selection. I have basic 'Select All' checkbox logic working, but without the additional criteria of 'Active' or 'Inactive'. Can someone help me to only select Active or !Active status_ind values for the checkboxes? Thanks in advance!

Select All logic:

var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;
}
checkflag = "true";
return "Uncheck All";
}
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false;
}
checkflag = "false";
return "Check All";
}
}

triggered by:

<input name="sa_active2" type="checkbox" id="sa_active2" value="checkbox" onKlick="this.value=check(this.form.selectBox)">Select All Active/>

The code for showing the list is:

<logic:iterate id="element" name="subgroupList" indexId="cCount">
<nested:root name="element">
<crmcustom:alttr indexName="cCount" bgcolor1="#ffffff" bgcolor2="#e7e7e7"/>
<td class="col1"><nested:checkbox property="selectBox" disabled="false"/></td>
<td class="col2" width="140px"><nested:write property="subgroup_no"/></td>
<td class="col3" width="140px"><nested:write property="status_ind"/></td>
</nested:root>
</tr>
</logic:iterate>
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Select only checkboxes matching criteria
 
Similar Threads
Select only checkboxes matching criteria
Checkboxes in servlets?
Error in action class
struts form HELP!
save checked value in checkbox to database