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);
}

解决方案 »

  1.   

    <tr onClick="line('<bean:write name="qq" property="hh" />','<bean:write name="qq" property="tt" />','<bean:write name="qq" property="ww" />',this)">
         
          <td>&nbsp;<bean:write name="qq" property="hh"/></td>
          <td>&nbsp;<bean:write name="qq" property="qq"/></td>
          <td>&nbsp;<bean:write name="qq" property="tt"/></td>
          <td>&nbsp;<bean:write name="qq" property="ww"/></td>
        </tr>
    是针对这样的一行,进行判断
      

  2.   

    基本思路是:
    选中一行时设置一个标志
    var isSelected = true;在submit时检查一下:
    if(!isSelected){
       alart("not selected");
       return false;
    } else{
       submit();
    }
      

  3.   

    如果点击一行,我获得了一个select值,如果在另外一个js中拿到这个值呢?