var len = document.forms[0].chk.length;
for(var i=0;i<len;i++){
if(document.forms[0].chk[i].checked){
alert(document.forms[0].requestNum[i].value+"qwe");
}
}
chk为复选框name值,requestNum为列的name值
获取复选框值
function chk(){
if(document.forms[0].chk==null){
return;
}
var chkId = '';
var len = document.forms[0].chk.length;
if(len>1){
var tag = 0;
for(var i=0;i<len;i++){
if(document.forms[0].chk[i].checked){
if (tag==0) {
chkId = chkId + document.forms[0].chk[i].value;
tag = 1;
} else {
chkId = chkId + ","+document.forms[0].chk[i].value;
}
}
}
} else {
if(document.forms[0].chk.checked){
chkId = document.forms[0].chk.value;
}
}
if (chkId=='') {
return;
}
return chkId;
}