<td width="80"><label>
                      
                        <input type="checkbox" name="checkbox3" value=<bean:write name="list" property="zzjh" /> />
                        <script type="text/javascript" language="javascript">
                        
                        if (document.all.forms[0].checkbox3.value = '1'){
                        alert("wwwwwwwww");
                        document.all.forms[0].checkbox3.checked = true;
                        }
                        
                        </script>
                    </label>
                  </td>我用FORM提交的 
<html:form action="zzjhqrOk.do">用的这种方式上面的该如何写 VALUE是通过查询出来LIST得到的值 如果是1 我想把钩选上

解决方案 »

  1.   


    <form>
     <input type="checkbox" name="checkbox3" value="1"/>
     <input type="checkbox" name="checkbox3" value="1"/>
     <input type="checkbox" name="checkbox3" value="2"/>
    </form>
      <script>
    var cboxs = document.forms[0].checkbox3;
    for(var i=0;i<cboxs.length;i++){
    if(cboxs[i].value=="1"){
    cboxs[i].checked = true;
    }
    }
      </script>
      

  2.   

    没看明白你要问什么~是从bean里面传过来一个值,然后根据这个值,来控制checkbox.是这样吧?
    你那个list是紧紧只是一个名字啊,还是一个List对象啊。完全让你搞懵了~