注册 登录
编程论坛 ASP技术论坛

三级下拉框 选中怎么改不刷新页面?

lxb0592 发布于 2012-07-22 08:49, 665 次点击
如图!选第一个框,第二框的相对应数据会出来,但同时整个页面会刷新,如何改成三级联动刷新数据,而不刷新页面???

只有本站会员才能查看附件,请 登录


代码:
<select name="type" onChange="form1.submit()">
          <option value="0"<%if nowtype="0" then%> selected="selected"<%end if%>>THDS</option>
        <option value="1"<%if nowtype="1" then%> selected="selected"<%end if%>>TFDS</option>
        <option value="2"<%if nowtype="2" then%> selected="selected"<%end if%>>TPDS</option>
        <option value="3"<%if nowtype="3" then%> selected="selected"<%end if%>>TADS</option>
        <option value="4"<%if nowtype="4" then%> selected="selected"<%end if%>>AEI</option>
        <option value="5"<%if nowtype="5" then%> selected="selected"<%end if%>>HMIS</option>
        <option value="6"<%if nowtype="6" then%> selected="selected"<%end if%>>电动脱轨器</option>
        <option value="7"<%if nowtype="7" then%> selected="selected"<%end if%>>手持机</option>
        <option value="8"<%if nowtype="8" then%> selected="selected"<%end if%>>智能风表</option>
        <option value="9"<%if nowtype="9" then%> selected="selected"<%end if%>>办公网络</option>
        </select></td>
        </tr>   
      </form>
      <form name="form2">
      <input type="hidden" name="type" value="<%=nowtype%>">
      <tr>
        <td align="right" height="30">故障所属大类:</td>
        <td class="category">
    <%
    sql="select * from money_bigclass where type="&nowtype&" order by id"
    set rs_bigclass=conn.execute(sql)
    if rs_bigclass.eof then
    %>
    <script language="javascript">
      alert("请先添加帐务大类!")
      window.location.href="../money/bigclass_add.asp"
    </script>
    <%
      response.end
    end if
    nowbigclass=request("bigclass")
    if nowbigclass="" then
      nowbigclass=rs_bigclass("id")
    end if
    %>
      <select name="bigclass" onChange="form2.submit()">
        <%
    do while rs_bigclass.eof=false
    %>
        <option value="<%=rs_bigclass("id")%>"<%if trim(cstr(rs_bigclass("id")))=nowbigclass then%> selected="selected"<%end if%>><%=rs_bigclass("bigclass")%></option>
        <%
      rs_bigclass.movenext
    loop
    %>
      </select>          </td>
        </tr>   
      </form>
      <form name="form3">
      <input type="hidden" name="bigclass" value="<%=nowbigclass%>">
      <input type="hidden" name="type" value="<%=nowtype%>">
      <tr>
        <td align="right" height="30">故障所属小类:</td>
        <td class="category">
    <%
    sql="select * from money_smallclass where id_bigclass="&nowbigclass&" order by id"
    set rs_smallclass=conn.execute(sql)
    %>
      <select name="smallclass">
        <option value="0"></option>
        <%
    do while rs_smallclass.eof=false
    %>
        <option value="<%=rs_smallclass("id")%>"<%if trim(cstr(rs_smallclass("id")))=nowsmallclass then%> selected="selected"<%end if%>><%=rs_smallclass("smallclass")%></option>
        <%
      rs_smallclass.movenext
    loop
    %>
      </select>          </td>
5 回复
#2
netlin2012-07-22 10:05
使用ajax异步方式读取数据
目前这种方式很流行了!
#3
lxb05922012-07-22 20:49
这么多高手说到! ajax技术,可是我不懂啊,看样子要学习学习这个技术了
#4
yms1232012-07-23 10:04
如果说ajax无刷新联动看我以前的精华帖子
https://bbs.bccn.net/viewthread.php?tid=129187&extra=page%3D1%26amp%3Bfilter%3Ddigest
#5
lxb05922012-07-23 19:06
谢谢版主! 我得认真学习下?不知道您看我这个代码能改成成功不?
#6
lxb05922012-07-24 14:47
回复 4楼 yms123
版主!如何把您这个技术用到我这里啊》?
1