string[] picked = Request.getparametervalues ("open");
if (picked!= null) {for
(int i = 0;i < Picked.length; i++) {
//System.out.println ("one" +picked[i]);
Udao.getcheckopen (Picked[i]);
}
Today with the mood of fear with the next checkbox, has always thought quite mysterious things, but when you decide to calm down to get it done, only to find things far from imagining difficulties O (∩_∩) o~
*****************************************************************************************************
From the Internet to find the theory:
(Gets the value in the checkbox)
string[] picked = Request.getparametervalues ("colname");
String[] A=new string[20];
if (picked!= null) {for
(int i = 0;i < Picked.length; i++) {
out.println ("" +picked[i]);
else {
out.println ("none");
}
How to implement a full selection of JSP page checkbox.
Use JavaScript.
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"
checkbox "Type=" Name= "chose" " Onclick= "SelectAll ()" id= "Checkbox5" >allselect
</form>
<script>
function SelectAll ()
{
if (!document.form.id.length) {
if (document.form.chose.checked) {
document.form.id.checked= true;
}
else{
document.form.id.checked=false
}
}
else{for
(var i=0;i<document.form.id.length;i++) {
if (document.form.chose.checked) {
document.form.id[i].checked=true;
}
else{
document.form.id[i].checked=false
}
}} </script>
******************************************************************************************************
My Code
JSP page code:
<script LANGUAGE = "JavaScript" >
<!--
function SelectAll ()
{
if (!) Document.form.open.length) {
if (document.form.chose.checked) {
document.form.open.checked=true;
}
else{
document.form.open.checked=false
}
}
else{for
(var i=0;i<document.form.open.length;i++) {
if (document.form.chose.checked) {
document.form.open[i].checked=true;
}
else{
document.form.open[i].checked=false
}
}} -->
</script>
<logic:present name= "infor" >
<logic:iterate id= "show" Name= "Infor" >
<tr bgcolor = ' #E7F1FE ' >
<td width= "5%" >
<logic:equal value= "not opened" name= "show" property= "status" >
<input type= "checkbox" name= "Open" value= "<bean:write name=" show "property=" Legalpersoncode "/>" >
</logic:equal>
Action inside the wording:
String[] picked = Request.getparametervalues ("open");
if (picked!= null) {
for (int i = 0;i < Picked.length; i++) {
// System.out.println ("one" +picked[i]);
Udao.getcheckopen (Picked[i]);
}
}