In many cases, online resources are always copied to paste. I make myself correct.CodeSent.
Code Implementation page multiple selection, and pass the checkbox array to the action
JSP page
Select all <input type = "checkbox" name = "selall" value = "" onclick = "selacheckbox (checked)"/> <br>
Banana <input type = "checkbox" name = "checkbox" value = "1"/>
Apple <input type = "checkbox" name = "checkbox" value = "2"/>
Pineapple <input type = "checkbox" name = "checkbox" value = "3"/>
Orange <input type = "checkbox" name = "checkbox" value = "4"/>
Page JavaScript Area
<Script language = "JavaScript">
Function selacheckbox (ischk ){
VaR arrchk = Document. getelementsbyname ("checkbox ");
For (VAR I = 0; I <arrchk. length; I ++ ){
Arrchk [I]. Checked = ischk;
}
}
</SCRIPT>
Action Area
String [] arrcheckbox = request. getparametervalues ("checkbox ");
OK, so that action can get the selected checkboxes and put the values of each checkbox into the array arrcheckbox.
I think everyone will do the next step.