日期:2014-05-16 浏览次数:20541 次
<script type="text/javascript">
        <!--
<% dim strOutput
ssql="select ygbh,ygxm,ssbm from rs_ygb where ryzt='0' or ryzt='2' order by ygxm asc" 
rs.Open ssql,conn,1,1
dim i
Do while(not rs.eof)
    strOutput = strOutput & ",[""" & rs("ygbh") & """,""" & rs("ygxm") & """,""" & rs("ssbm") & """]"
    rs.movenext
Loop
rs.close
if (strOutput<>"")Then
    strOutput = mid(strOutput,2)
end if
 %>
var ary = [<%= strOutput %>]
function chgbm(){
    var i,e,j,ba,opts;
    opts = frmxx.dxry.options;
    opts.length = 0;
    for (i=0; i<ary.length; i++) {
        if(frmxx.bm.value==ary[i][2] || frmxx.bm.value=="X"){
            ba=0
            for(j=0; j<frmxx.yxry.length; j++){
                if(ary[i][0]==frmxx.yxry.item[j].value){
                    ba=1;
                    break;
                }
            }
            if(ba==0){
                opts[opts.length] = new Option(ary[i][0],ary[i][1]);
            }
        }
    }
}
        //-->
        </script>
------解决方案--------------------
if((","+ary(4,i)+",").indexOf(","+frmxx.ug.value+",")>0||frmxx.ug.value=="X"){
  //do something.............
}