String[] picked = ("open"); if (picked != null) { for (int i = 0;i < ; i++) { // ("11"+picked[i]); ( picked[i]); } }
Today I used checkbox with panic and always thought it was quite mysterious, but when you decided to calm down and get it done, I realized that things were far less difficult than I imagined O(∩_∩)O~
*****************************************************************************************************
Theories found online:
(Get the value in checkbox)
String[] picked = ("colname"); String[] a=new String[20]; if (picked != null) { for (int i = 0;i < ; i++) { (" "+picked[i]); } else { ("none"); }
How to achieve the selection of all jsp page checkbox.
Use javascript.
<html> <body> <script> function kk(){ var handleEl = ("kkHandler"); var els = ("kk"); for(i=0;i<;i++){ els[i].checked = ; } } </script> <input type=checkbox onclick="kk()" name="kkHandler">Select all<br> <input type=checkbox name="kk"> <input type=checkbox name="kk"> </body> </html>
2:
<form name="form" ID="Form1"> <input type="checkbox" name="id" value="" ID="Checkbox1">1 <input type="checkbox" name="id" value="" ID="Checkbox2">2 <input type="checkbox" name="chose" value="" onclick="selectAll()" ID="Checkbox5">allselect </form> <script> function selectAll() { if(!){ if(){ =true; } else{ =false; } } else{ for(var i=0;i<;i++){ if(){ [i].checked=true; } else{ [i].checked=false; } } } } </script>
******************************************************************************************************
My code
jsp page code:
<script LANGUAGE = "javaScript"> <!-- function selectAll() { if(!){ if(){ =true; } else{ =false; } } else{ for(var i=0;i<;i++){ if(){ [i].checked=true; } else{ [i].checked=false; } } } } --> </script> <logic:present name="Infor"> <logic:iterate name="Infor"> <tr bgcolor = '#E7F1FE'> <td width="5%"> <logic:equal value="Not activated" name="show" property="status"> <input type="checkbox" name="open" value="<bean:write name="show" property="legalPersonCode" />"> </logic:equal>
How to write in action:
String[] picked = ("open");
if (picked != null) {
for (int i = 0;i < ; i++) {
// ("11"+picked[i]);
( picked[i]);
}
}