给你一段代码,你试验一下: <form action = "b.jsp" name ="form1"> <input type = "checkbox" name = "checkbox" value ="0">apple <input type ="checkbox" name = "checkbox" value = "1">banana <input type = "checkbox" name = "checkbox" value = "2">orange <input type = "button" value= "提交" onclick= "form1.submit()"> 在b.jsp页面中: String[] mm= request.getparametervalues(checkbox); for(inti=0,i<mm.length;i++){ out.println("check "+mm[i]); } 其中mm[i]就是你选择 的对象 给你提供个思想,代码是我自己写的,有可能有点语法错误,不太碍事!
返回的就有几个值,
这些值放在一个字符串数组中,
即:String[] aStrData = request.getParameterValues("checkboxName");
String[] id = request.getParameterValues("Cid");for(int i=0;i<id.length;i++){
out.println(id[i]);
}
<form action = "b.jsp" name ="form1">
<input type = "checkbox" name = "checkbox" value ="0">apple
<input type ="checkbox" name = "checkbox" value = "1">banana
<input type = "checkbox" name = "checkbox" value = "2">orange
<input type = "button" value= "提交" onclick= "form1.submit()">
在b.jsp页面中:
String[] mm= request.getparametervalues(checkbox);
for(inti=0,i<mm.length;i++){
out.println("check "+mm[i]);
}
其中mm[i]就是你选择 的对象
给你提供个思想,代码是我自己写的,有可能有点语法错误,不太碍事!