编程论坛
注册
登录
编程论坛
→
J2EE论坛
[求助]批量问题?
luyihuaa5201
发布于 2007-10-28 22:26, 506 次点击
我在做项目的时候发现了一个问题,就是在做批量删除时,当只有一条记录时,全选会失效,并且传入的数组长度没有赋值,请问该怎么判断。
2 回复
#2
a276202460
2007-10-29 19:58
用它的索引不管是几个都能选上删除吧
#3
suncf1985
2007-10-31 09:33
页面:
<input type="checkBox" name="checkBox" />
<input type="checkBox" name="checkBox" />
<input type="checkBox" name="checkBox" />
<input type="checkBox" name="checkBox" />
Action 中:
用这个方法就能取出先中的 checkBox 了
String[] checkBox = request.getParameterValues("checkBox");
checkBox.length() 就能得到长度(也就是checkBox选中的个数)
1