搜索一下,或到asp搜索,已经很多了

解决方案 »

  1.   

    实现传递代码如下:---------------------------------------
    <script language="javascript">
    var aListValue = new Array(2); 
    aListValue["a"] = new Array("1","2");
    aListValue["b"] = new Array("3");var nCurIndex = null;function setupList()
    {
      if (nCurIndex != document.frmtest.name1.selectedIndex)
      {
    nCurIndex = document.frmtest.name1.selectedIndex;var sValue = document.frmtest.name1.options[nCurIndex].value;var i;
    //remove existing list
    for (i=document.frmtest.name2.options.length-1; i >=0 ; i--)
    document.frmtest.name2.options.remove(i);for (i=0; i < aListValue[sValue].length;i++)
    {
    var opt = new Option(aListValue[sValue][i],aListValue[sValue][i]);
    document.frmtest.name2.options.add(opt);
    }  }}
    </script><body onload="setupList()">
    <form name="frmtest" action="" method="post">
    List1: <select name="name1" onchange="setupList()">
    <option value="a">a</option>
    <option value="b">b</option>
    </select><br>
    List2:
    <select name="name2">
    </select><br>
    </form>
    </body>
     
      

  2.   

    实现方法一、因为这种设计数据量一般不多
        在页面初装时,利用ASP/JSP程序读取数据库,将两个<select>的数据全部读取出来,并对上述aListValue进行赋值即可实现要求。二、数据量较大时
       读取第一个<select>的数据,选择了其中一个选项之后,从数据库读取数据重新生成第二个<select>,这个没有什么难的吧?
      

  3.   

    我用showModalDialog打开第一个页面,用表单提交后,虽然选择的是 
    target="_self" ,但是它还是打开一个新页面????怎么办!
     
      

  4.   

    执行下面代码:从SQL探测器中发现IIS 不断查询SQL服务器。而使脚本执行时间超出设置时间!问题在那???请指点读分支机构表 的两字段到两数组里
    <%
    connstr=application("oa_connectionstring")
    set conn=server.CreateObject ("adodb.connection")
    set rs=server.CreateObject ("adodb.recordset")
    conn.Open connstr
    dim sql
    sql="select distinct 市县 from 分支机构表 "
    rs.Open sql,connstr,1 ,1 
    f=rs.RecordCount 
    Response.Write("f is ="&f)
    %><HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
    </HEAD><script language="javascript">var a_muni=new Array();
    a_muni[0]="请选择";
    a_muni[1]="";
    <%
    temp_i=2
    municount=0
    dim  munipart()
    redim munipart(rs.recordcount-1)
    'response.write"<p>before code is ok"
    while not rs.eof
     municount=municount+1
     munipart(municount-1)=rs("市县")
    ' response.write("<p>munipart="&munipart(municount-1))
    %> 
     a_muni[<%=temp_i%>]="<%=rs("市县")%>";
     a_muni[<%=temp_i+1%>]="<%=rs("市县")%>";
    <%
     temp_i=temp_i+2
     rs.movenext
     wend
     rs.close
     %>  var village=new array()
    <% for temp_i=0 to temp_i/2-1 %>
       village[<%=temp_i%> =new array();
       <% next %>
       village[0][0]="请选择";
       village[0][1]=""; 
    <%
     temp_i=1
     while temp_i<=municount 
     %>
     village[<%=temp_i%>][0]="请选择";
     village[<%=temp_i%>][0]="";
     <%
     response.write("munipart[temp_i]"&munipart(temp_i))
     sql="select 企业_id ,乡镇 from 分支机构表 where 市县='"&munipart(temp_i)&"'"
     set rs=conn.execute(sql)
     temp_j=2
     while not rs.eof
     %>
     village[<%=temp_i%>][<%=temp_j%>]="<%=rs("乡镇")%>";
     village[<%=temp_i%>][<%=temp_j+1%>]="<%=rs("企业_id")%>";
     <%
     temp_j=temp_j+2
     rs.movenext
     wend
     temp_j=tem_j+1
     wend
     %>
    </script>