在js里面如果取得table里面的checkbox集会,方便判断是否有选择项<table id="Office_Voting1_ItemCheckBoxList" border="0">
<tr>
<td><input id="Office_Voting1_ItemCheckBoxList_0" type="checkbox" name="Office_Voting1$ItemCheckBoxList$0" /><label for="Office_Voting1_ItemCheckBoxList_0">很好</label></td>
</tr><tr>
<td><input id="Office_Voting1_ItemCheckBoxList_1" type="checkbox" name="Office_Voting1$ItemCheckBoxList$1" /><label for="Office_Voting1_ItemCheckBoxList_1">好</label></td>
</tr><tr>
<td><input id="Office_Voting1_ItemCheckBoxList_2" type="checkbox" name="Office_Voting1$ItemCheckBoxList$2" /><label for="Office_Voting1_ItemCheckBoxList_2">一般</label></td>
</tr><tr>
<td><input id="Office_Voting1_ItemCheckBoxList_3" type="checkbox" name="Office_Voting1$ItemCheckBoxList$3" /><label for="Office_Voting1_ItemCheckBoxList_3">差</label></td>
</tr><tr>
<td><input id="Office_Voting1_ItemCheckBoxList_4" type="checkbox" name="Office_Voting1$ItemCheckBoxList$4" /><label for="Office_Voting1_ItemCheckBoxList_4">很差</label></td>
</tr>
</table>
<tr>
<td><input id="Office_Voting1_ItemCheckBoxList_0" type="checkbox" name="Office_Voting1$ItemCheckBoxList$0" /><label for="Office_Voting1_ItemCheckBoxList_0">很好</label></td>
</tr><tr>
<td><input id="Office_Voting1_ItemCheckBoxList_1" type="checkbox" name="Office_Voting1$ItemCheckBoxList$1" /><label for="Office_Voting1_ItemCheckBoxList_1">好</label></td>
</tr><tr>
<td><input id="Office_Voting1_ItemCheckBoxList_2" type="checkbox" name="Office_Voting1$ItemCheckBoxList$2" /><label for="Office_Voting1_ItemCheckBoxList_2">一般</label></td>
</tr><tr>
<td><input id="Office_Voting1_ItemCheckBoxList_3" type="checkbox" name="Office_Voting1$ItemCheckBoxList$3" /><label for="Office_Voting1_ItemCheckBoxList_3">差</label></td>
</tr><tr>
<td><input id="Office_Voting1_ItemCheckBoxList_4" type="checkbox" name="Office_Voting1$ItemCheckBoxList$4" /><label for="Office_Voting1_ItemCheckBoxList_4">很差</label></td>
</tr>
</table>
解决方案 »
- 问大家一个问题
- 运行vs2010,Debug时发生“无法启动程序http://localhost: 找不到元素”
- 刚刚毕业的小菜鸟,现在在一个小城市,小公司,做一些很基础的开发,应该怎样提高自己开发水平?
- 一个超级郁闷的treeview的显示问题,请高手进来~
- 求教用ASP.net解决个从数据库取数据传入到表格的问题
- 如何提取gridview里最后一行数据?
- 如何获取vs2005中loginname中的用户名和ID
- 怎样限制上传文件大小
- 请问怎样提取数据库的前三条数据啊??
- 遍历一个list 如何给Datatable的行进行赋值呢?
- GridView更新时错误,希望有人帮助。困扰很久了!
- 如何访问 repeater中<FooterTemplate>里面的label控件
var c=document.getElementById("Office_Voting1_ItemCheckBoxList").document.getElementsByTagName("input");
for(var i=0;i<c.length;i++){
if(c[i].type=="checkbox"&&c[i].checked){
value+=c[i].value+",";
}
}
alert(value)