|
看不清楚吗?
<select name="fjgsc" fjr="selectformat" id="fjgsc" onMouseOver="this.focus();" onChange="make_fjgse_menu(this.value,document.input_form.fjgse)">
<option value="" selected>--DHL发件公司(中文)--</option>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select fjgsc from fjgsc order by fjgsc desc"
rs.open sql,conn ,1,1
if rs.recordcount<>0 then
do while not rs.eof
%>
<option value="<%=rs("fjgsc")%>" ><%=rs("fjgsc")%></option>
<%
rs.movenext
loop
end if
%>
</select>
...............................................................................................................................
//二级
<select name="fjgse" fjr="selectformat" id="select4" onMouseOver="this.focus();">
<option value="" selected>--DHL发件公司(英文)--</option>
</select>
.....................................................................................................................................
//函数
<script language="JavaScript" >
function make_fjgse_menu(fjgsc_value,fjgse_X)
{
var sql = "select * from fjgse where fjgsc='"+fjgsc_value+"'" ;
var ConnDB = new ActiveXObject("adodb.connection");
var rs = new ActiveXObject("ADODB.Recordset");
ConnDB.ConnectionString="DSN=data;uid=data;pwd=data";
ConnDB.open
rs.open(sql,ConnDB,1,1);
if(rs.recordcount!=0)
{
var count=1;
fjgse_X.options[0]=new Option("--请选择发件公司名称(英文)--"," ");
while(!rs.eof)
{
fjgse_X.options[count]=new Option(rs("fjgse"),rs("fjgse"));
count=count+1;
rs.movenext
}
var sql=null;
rs.close
ConnDB.close
fjgse_X.options[0].selected=true;
fjgse_X.length=count;
}
else
{
fjgse_X.options[0]=new Option("--请选择发件公司名称(英文)--"," ");
var sql=null;
rs.close
ConnDB.close
fjgse_X.options[0].selected=true;
fjgse_X.length=1;
}
} |
|