日期:2014-05-18  浏览次数:20772 次

我的checkbox值怎么取不到!!!!!急,在线等待
<script>
function checkOut(){
  var chk=document.chkForm.miifmp.value
}
</script>


<form name="chkForm">
<td align="center">
<c:if test="${list.miifmp=='Y'}">
input type=checkbox name="miifmp" checked>
</c:if>
<c:if test="${list.miifmp=='N'}">
<input type=checkbox name="miifmp">
</c:if>
<c:if test="${list.miifmp==null}">
<input type=checkbox name="miifmp">
</c:if>
</td>
<input type="button" onclick="checkOut">
</form>

老是提示说是document.chkForm.miifmp为空或者不是对象,像这种一个checkbox,如何在js中获取它的值

谢谢!!!!!!!


------解决方案--------------------
form name="chkForm"> 
<td align="center"> 
<c:if test="${list.miifmp=='Y'}"> 
<input type=checkbox name="miifmp" checked> 
</c:if> 
<c:if test="${list.miifmp=='N'}"> 
<input type=checkbox name="miifmp"> 
</c:if> 
<c:if test="${list.miifmp==null}"> 
<input type=checkbox name="miifmp"> 
</c:if> 
</td> 
<input type="button" onclick="checkOut"> 
</form> 


可以<input type=checkbox name ="miifmp" value="???" checked>