<SCRIPT LANGUAGE=javascript>
<!--
var prv=new Array()//医院
var cty=new Array()//级别
var khlb=new Array()//类别
function init(){
<%
dim prv,cty,khlb,i,j,k
dim sq1
i=0
//sq1=document.frm.sq.value
set prv=conn.execute("select yy_mingcheng from sale_manage_khda_mbyyda where dy_bianma='"&s_dy_bianma&"' order by yy_mingcheng")
if not prv.eof then
do while not prv.eof
j=0
k=0
%>
prv[<%=i%>]="<%=trim(prv("yy_mingcheng"))%>";
<%
set cty=conn.execute("select yylb_mingcheng from sale_manage_bianma_yylb as a join sale_manage_khda_mbyyda as b on b.yy_leibie=a.yylb_bianma where b.yy_mingcheng = '"&trim(prv("yy_mingcheng"))&"'")
if not cty.eof then%>
cty[<%=i%>]=new Array()
<%do while not cty.eof%>
cty[<%=i%>][<%=j%>]="<%=trim(cty("yylb_mingcheng"))%>"
<%j=j+1
cty.movenext
loop
end if
cty.close :set cty=nothing
%>
<%
set khlb=conn.execute("select khb_shuoming from sale_base_khlx as a join sale_manage_khda_mbyyda as b on b.khb_bianma=a.khb_bianma where b.yy_mingcheng = '"&trim(prv("yy_mingcheng"))&"'")
if not khlb.eof then%>
khlb[<%=i%>]=new Array()
<%do while not khlb.eof%>
khlb[<%=i%>][<%=k%>]="<%=trim(khlb("khb_shuoming"))%>"
<%k=k+1
khlb.movenext
loop
end if
khlb.close :set khlb=nothing

i=i+1
prv.movenext
loop
end if
prv.close :set prv=nothing
%>
if(prv.length >0){
for(i=0;i<prv.length;i++)
with(document.frm.province)options[length]=new Option(prv[i],prv[i])
document.frm.province.onchange=new Function("go(this.selectedIndex)")
}
}function go(sIndex){
with(document.frm.city){
length=0;
if(sIndex==0){options[0]=new Option("显示医院级别");return}
for(i=0;i<cty[sIndex-1].length;i++)
options[length]=new Option(cty[sIndex-1][i],cty[sIndex-1][i])
}
with(document.frm.yylb){
length=0;
if(sIndex==0){options[0]=new Option("显示医院类别");return}
for(i=0;i<khlb[sIndex-1].length;i++)
options[length]=new Option(khlb[sIndex-1][i],khlb[sIndex-1][i])
}
}
window.onload=init
-->
</SCRIPT>

解决方案 »

  1.   

    大哥,能明确一点么?
    我刚开始用javascript。谢谢
      

  2.   

    <select name="test" onclick="javascript:Select()">
    <option value="a">a</option>
    <option value="b">b</option>
    <option value="c">c</option>
    <option value="d">d</option>
    </select>在javascript里面
    function Select(){
    for(var i=0;i<document.all.test.length;i++)
    if(document.all.test[i].checked==true
    alert(document.all.test[i])
    }
    这样就可以拉
      

  3.   

    if(document.all.test[i]==true)
    对不起少了个")"
      

  4.   

    <html>
    <head>
    <title> New Document </title>
    <script>
    function showSelectedValue()
    {

    var selectedValue = "";
    var objSelect = document.form1.test;
    for(var i = 0; i < objSelect.options.length; i++)
    {
    if (objSelect.options[i].selected == true)
    selectedValue += objSelect.options[i].value + "\r\n";
    }
    alert(selectedValue);
    }
    </script>
    </head>
    <body>
    <form name="form1">
    <select name="test" multiple >
    <option value="a">a</option>
    <option value="b">b</option>
    <option value="c">c</option>
    <option value="d">d</option>
    </select>
    <input type="button" value="showSelectedValue" onClick="javascript: {showSelectedValue();}">
    </form>
    </body>
    </html>