<script>
 function test(){
var objs = document.all.tags("input") ;
for(i=0;i<objs.length;i++){
if (objs[i].type=="checkbox"&&objs[i].checked)
alert(objs[i].value) ;
}
 }
</script>
<input type=checkbox value=1>
<input type=checkbox value=2>
<input type=checkbox value=3>
<input type=button value=test onclick=test();>

解决方案 »

  1.   

    不用提交已经解决。
    用parent好象不行在子窗口的JS我是这样写的:
    function submit2(){
     // gocontent.action="<%=request.getContextPath()%/report/loan.jsp";
     // gocontent.submit();
    var len=document.gocontent.itemid.length; var itemidstr="";
    if(!len){      if(document.gocontent.itemid.checked == true) {
     itemidstr = document.gocontent.itemid.value;  window.opener.document.forms[0].itemid.value=itemidstr;
      }
        
    }
    else if (len>1){
    for(k=0;k<len;k++){
         if(document.gocontent.itemid[k].checked == true){
    if (k==0) 
     itemidstr=itemidstr + document.gocontent.itemid[k].value;
    else 
     itemidstr=itemidstr + "," + document.gocontent.itemid[k].value;
    window.opener.document.forms[0].itemid.value=itemidstr;
     }
        }

        }
     window.close();
    }