日期:2014-05-18 浏览次数:20515 次
unction saveId() { var list = document.getElementsByName("cbCheak"); for (var i = 0; i < list.length; i++) { var bcids = document.getElementById("hdBCIDS").value; var bcidlist = bcids.split(','); if (list[i].checked) { var isExtise = false; for (var j = 0; j < bcidlist.length; j++) { if (list[i].value == bcidlist[j]) { isExtise = true; break; } } if (!isExtise) { bcids += list[i].value + ","; } } else { var isExtise = false; for (var j = 0; j < bcidlist.length; j++) { if (list[i].value == bcidlist[j]) { isExtise = true; break; } } if (isExtise) { bcids = ""; for (var h = 0; h < bcidlist.Length; h++) { if (bcidlist[h] != list[i].value) { bcids+=li[h] } } } } document.getElementById("hdBCIDS").value = bcids; } }
------解决方案--------------------
for (int i = 0; i < Repeater1.Items.Count; i++) { CheckBox cxx = (CheckBox)Repeater1.Items[i].FindControl("CheckBoxID"); if (cxx.Checked) { Response.Write(i); } }
------解决方案--------------------
string CheckString = ""; int zz = 0; for (int i = 0; i < Repeater1.Items.Count; i++) { CheckBox cxx = (CheckBox)Repeater1.Items[i].FindControl("CheckBox1"); if (cxx.Checked) { CheckString = (zz = zz + 1).ToString(); } }