获取CheckBoxList选中项的Text值
2016-11-15 10:02
295 查看
function getSelectedUser() {
var strReturn = "";
var CheckBoxList = document.getElementById("<%=cblNextUser.ClientID %>");
if (CheckBoxList.tagName == "TABLE") {
for (i = 0; i < CheckBoxList.rows.length; i++)
for (j = 0; j < CheckBoxList.rows[i].cells.length; j++)
if (CheckBoxList.rows[i].cells[j].childNodes[0])
if (CheckBoxList.rows[i].cells[j].childNodes[0].checked == true) {
if(strReturn!="")strReturn+=",";
strReturn+=CheckBoxList.rows[i].cells[j].childNodes[1].innerText;
}
}
if (CheckBoxList.tagName == "SPAN") {
for (i = 0; i < CheckBoxList.childNodes.length; i++)
if (CheckBoxList.childNodes[i].tagName == "INPUT")
if (CheckBoxList.childNodes[i].checked == true) {
if (strReturn != "") strReturn += ",";
strReturn += CheckBoxList.rows[i].cells[j].childNodes[1].innerText;
}
}
alert(strReturn);
}
var strReturn = "";
var CheckBoxList = document.getElementById("<%=cblNextUser.ClientID %>");
if (CheckBoxList.tagName == "TABLE") {
for (i = 0; i < CheckBoxList.rows.length; i++)
for (j = 0; j < CheckBoxList.rows[i].cells.length; j++)
if (CheckBoxList.rows[i].cells[j].childNodes[0])
if (CheckBoxList.rows[i].cells[j].childNodes[0].checked == true) {
if(strReturn!="")strReturn+=",";
strReturn+=CheckBoxList.rows[i].cells[j].childNodes[1].innerText;
}
}
if (CheckBoxList.tagName == "SPAN") {
for (i = 0; i < CheckBoxList.childNodes.length; i++)
if (CheckBoxList.childNodes[i].tagName == "INPUT")
if (CheckBoxList.childNodes[i].checked == true) {
if (strReturn != "") strReturn += ",";
strReturn += CheckBoxList.rows[i].cells[j].childNodes[1].innerText;
}
}
alert(strReturn);
}
相关文章推荐
- Js获取checkboxlist所选中的值
- js获取CheckBoxList选中的值
- .net 获取checkBoxList 选中的值|radiobuttonlist|dropdownlist
- Js获取checkboxlist所选中的值
- CheckBoxList 无法通过js获取选中value值 - 解决方案
- 用JavaScript获取Asp.net服务器端控件CheckBoxList的选中值数组
- 用JavaScript获取Asp.net服务器端控件CheckBoxList的选中值数组
- Jquery 获取CheckBoxList 中选择的值和获取RadioButton 选中的状态
- 用JavaScript获取Asp.net服务器端控件CheckBoxList的选中值数组
- 用JavaScript获取Asp.net服务器端控件CheckBoxList的选中值数组
- 用JavaScript获取Asp.net服务器端控件CheckBoxList的选中值数组
- DEV treeList 获取 ListcheckBox选中节点内容
- 用JavaScript获取Asp.net服务器端控件CheckBoxList的选中值数组
- js 获取CheckBoxList选中的值
- 用JavaScript获取Asp.net服务器端控件CheckBoxList的选中值数组(转)
- .net 获取checkBoxList 选中的值|radiobuttonlist|dropdownlist
- 用JavaScript获取Asp.net服务器端控件CheckBoxList的选中值数组
- CheckBoxList 获取与设置选中的值
- 用JavaScript获取Asp.net服务器端控件CheckBoxList的选中值数组
- CheckBoxList多选,获得选中的值!