日期:2014-05-16  浏览次数:20386 次

js判断所选择的行中某一列时候为同一个值

?//begin? 判断所选条目日期是否为同一天(haihang--zhangmiao)
?var? rows = document.getElementById("t_contract").rows;?????//t_contract为表的id
?var? dates = new Array();
?var m = 0;
?for(var i=1;i<rows.length;i++){
??? if(rows[i].cells[0].children[0].checked)
??? {
???????? var? value = rows[i].cells[0].children[0].value;
???????? var? redate = document.getElementById("redate_" + value).innerText;?//要判断日期td加上id
???????? for (var j = 0; j < dates.length; ++j){
????????????? if (redate != dates[j]){
??????????????? alert("所选票据转帖日期必须是同一天!");
??????????????? return false;
????????????? }
??????????? }
??????????? dates[m++] = redate;
??????????
??? }
?}
?//end