jsp复选框全选的问题
jsp中:
<input type="checkbox" name="seatresult" value="0" onclick='check_all();'/>全选
<ul class="messageright">
<c:forEach items="${seatlist1}" var="v">
<li> <input type="checkbox" property="seatresult" name="seatresult" value="${v.ext}">${v.ext}${v.name}</li>
</c:forEach>
<div class="clear"></div>
</ul>
<script >
var check=true;
function check_all(){
if(check==false)
{
arr = document.getElementsByName("seatresult");
for(i=0;i<arr.length;i++){
arr[i].checked = false
}
check=true;
} else{
arr = document.getElementsByName("seatresult");
for(i=0;i<arr.length;i++){
arr[i].checked = true
}
check=false;
}
}
</script>
action中:
private String[] seatresult; 并提供set和get方法
public ActionForward saveMessage(){
seatresult=StrutsEnv.getRequest().getParameterValues("seatresult");
StringBuffer sb=new StringBuffer();
for (String string : seatresult) {
sb.append(string+"#");
}
String newsb=sb.toString();
if(newsb.startsWith("")){
newsb="#"+newsb;
}
现在的问题就是在jsp保存的时候 页面提示错误:对象不支持此属性或方法,请大家帮忙看看
------解决方案--------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title></title>
<script type="text/javascript">
function allSelect() {
var flag = document.getElementById("all").checked;
var cbs = document.getElementsB