function SubmitToOther(strAction,strFlag){
var i,j=0;
var id = new String();;
var str = new String();
for ( i=0; i< frmList.length; i++ ) {
str = frmList.item(i).id;
if ( str.substr(0,8) == "checkbox" &&
frmList.item(i).checked == true ){
j++;
id += frmList.item(i).value+",";
}
}
if ( j == 0 && strFlag == "1" ){
alert("请至少选择一条记录!");
return(false);
}
id = id.substring(0,id.length-1);
return(true);
}
var i,j=0;
var id = new String();;
var str = new String();
for ( i=0; i< frmList.length; i++ ) {
str = frmList.item(i).id;
if ( str.substr(0,8) == "checkbox" &&
frmList.item(i).checked == true ){
j++;
id += frmList.item(i).value+",";
}
}
if ( j == 0 && strFlag == "1" ){
alert("请至少选择一条记录!");
return(false);
}
id = id.substring(0,id.length-1);
return(true);
}
<td> <bean:write name="qq" property="hh"/></td>
<td> <bean:write name="qq" property="qq"/></td>
<td> <bean:write name="qq" property="tt"/></td>
<td> <bean:write name="qq" property="ww"/></td>
</tr>
是针对这样的一行,进行判断
选中一行时设置一个标志
var isSelected = true;在submit时检查一下:
if(!isSelected){
alart("not selected");
return false;
} else{
submit();
}