| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 708 人关注过本帖
标题:有简单方法实现3级联动下拉框选择刷新数据而不刷新页面不?
只看楼主 加入收藏
lxb0592
Rank: 1
等 级:新手上路
帖 子:108
专家分:0
注 册:2012-5-28
结帖率:86.67%
收藏
已结贴  问题点数:20 回复次数:2 
有简单方法实现3级联动下拉框选择刷新数据而不刷新页面不?
图片附件: 游客没有浏览图片的权限,请 登录注册

可以只通过修改代码实现下拉框选择刷新数据而不刷新页面不?
<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
    %>



搜索更多相关主题的帖子: option 简单方法 selected 
2012-09-27 16:04
xmlz
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:5
帖 子:294
专家分:1392
注 册:2010-8-29
收藏
得分:20 
如果觉得ajax复杂,那就把所有数据都写入javascript里,操作全部在前台完成,但是这样客户端代码会比较臃肿(如果备选项比较多的话)
2012-09-28 08:26
lxb0592
Rank: 1
等 级:新手上路
帖 子:108
专家分:0
注 册:2012-5-28
收藏
得分:0 
哦! 我就是不想改太多,麻烦 AJAX又不太懂!
2012-09-29 18:15
快速回复:有简单方法实现3级联动下拉框选择刷新数据而不刷新页面不?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012866 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved