| 域名空间 下载中心 社区论坛 信息公告 my小屋 |
![]() |
联系我们 设为首页 加入收藏 |
|
首页 | 新闻资讯 | 编程开发 | 网页设计 | 图形图象 | 网络媒体 | 网站模板 | 数 据 库 | 投稿 论坛 | 操作系统 | 系统优化 | 网络安全 | 黑客技术 | 硬件学堂 | 硬件报价 | 服 务 器 | 地图 专题 | 应用软件 | 聊天通讯 | q q 专栏 | 建站经验 | 在线工具 | 站长club | 注 册 表 | 旧版 社会 | 游戏娱乐 | 设计欣赏 | 疑难解答 | 社区论坛 | 韩国素材 | 素材图库 | 广告服务 | 服务 |
| 新版上线![旧版] | |||||
注:打开慢时请稍等
在线等!请进来看~~!先拜谢!!http://www.iyit.net 日期:2006-10-6 15:37:21 来源:iyit.net收集 点击: |
如数据库里有条记录字段名为‘序列号’‘名称’‘数量’,值分别为‘1’‘交换机’‘10’。 现有一个下拉框和两个文本框,要求下拉框里的值是字段‘序列号’下的值1,当选1的时候,文本框相对应的显示字段‘名称’和‘数量’的值,如何实现? --------------------------------------------------------------- http://expert.csdn.net/expert/topic/2970/2970355.xml?temp=.1002924 --------------------------------------------------------------- 连动问题: newbig: create table [dbo].[newbig] ( [bigid] [nvarchar] (2) collate chinese_prc_ci_as not null , [bigtypes] [nvarchar] (30) collate chinese_prc_ci_as not null ) newmiddle create table [dbo].[newmiddle] ( [middleid] [nvarchar] (3) collate chinese_prc_ci_as not null , [middletypes] [nvarchar] (25) collate chinese_prc_ci_as not null , [bigid] [nvarchar] (10) collate chinese_prc_ci_as null ) newsmall create table [dbo].[newsmall] ( [smallid] [nvarchar] (5) collate chinese_prc_ci_as not null , [smalltypes] [nvarchar] (25) collate chinese_prc_ci_as null , [middleid] [nvarchar] (10) collate chinese_prc_ci_as null ) <table width="498" border="0" cellspacing="0" cellpadding="0"> <tr> <td > <!-- #include file="conn.asp"--> <script language=javascript> function cc(theform5) { if ((theform5.txt.value=="") &&(theform5.sheng.value=="")&&(theform5.bigtypes.value=="")) { alert("查询条件都不能为空。"); theform5.txt.focus(); return false; } return true; } </script> <% sql = "select shengid,cityid,sheng,city from newcity order by cityid" set obj = conn.execute(sql) %> <script language = "javascript"> var onecouant; onecouant=0; subcata = new array(); <% count1 = 0 do while not obj.eof %> subcata[<%=count1%>] = new array("<%= trim(obj("city"))%>","<%= trim(obj("shengid"))%>","<%= trim(obj("cityid"))%>"); <% count1 = count1 + 1 obj.movenext loop obj.close set obj=nothing %> onecouant=<%=count1%>; function changelocation3(id) { document.f1.city.length = 0; var id=id; var i; document.f1.city.options[0] = new option('----------请选择城市---------',''); for (i=0;i < onecouant; i++) { if (subcata[i][1] == id) { document.f1.city.options[document.f1.city.length] = new option(subcata[i][0], subcata[i][2]); } } } </script></td> </tr> </table> <form name="f1" method="post" action="newenterprise/allsearch.asp" onsubmit="return cc(f1)"> <table width="400" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff"> <tr bgcolor="e6e6e6"> <td width="101" height="35" align="center"><strong>选择省份</strong></td> <td width="349" height="35"><select name="sheng" onchange="changelocation3(document.f1.sheng.options[document.f1.sheng.selectedindex].value)" size="1"> <option value="" selected>----------请选择省份---------</option> <% sql1 = "select shengid,sheng from newsheng order by shengid" set obj1 = conn.execute (sql1) do while not obj1.eof %> <option value="<%=trim(obj1("shengid"))%>"><%=trim(obj1("sheng"))%></option> <% obj1.movenext loop obj1.close set obj1 = nothing %> </select></td> </tr> <tr bgcolor="e6e6e6"> <td width="101" height="35" align="center"><strong>地区(市)</strong></td> <td width="349" height="35"><select name="city" size="1"> <option value="" selected>------请选择城市------</option> </select></td> </tr> <script language="javascript"> changelocation3(document.f1.sheng.options[document.f1.sheng.selectedindex].value); </script> <tr bgcolor="e6e6e6"> <td width="101" height="33" align="center"><strong>行业大类</strong></td> <td width="349" height="33"><% sql = "select bigid,middleid,middletypes from newmiddle order by middleid" set rs = conn.execute(sql) %> <script language = "javascript"> var onecount; onecount=0; subcat = new array(); <% count = 0 do while not rs.eof %> subcat[<%=count%>] = new array("<%= trim(rs("middletypes"))%>","<%= trim(rs("bigid"))%>","<%= trim(rs("middleid"))%>"); <% count = count + 1 rs.movenext loop rs.close set rs=nothing %> onecount=<%=count%>; function changelocation(locationid) { document.f1.middletypes.length = 0; var locationid=locationid; var i; document.f1.middletypes.options[0] = new option('--中类行业--',''); for (i=0;i < onecount; i++) { if (subcat[i][1] == locationid) { document.f1.middletypes.options[document.f1.middletypes.length] = new option(subcat[i][0], subcat[i][2]); } } } </script> <%sql2 = "select smalltypes,middleid,smallid from newsmall order by smallid" set rs2 = conn.execute(sql2) %> <script language = "javascript"> var onecount2; onecount2=0; subcat2 = new array(); <% count2 = 0 do while not rs2.eof %> subcat2[<%=count2%>] = new array("<%= trim(rs2("smalltypes"))%>","<%= trim(rs2("middleid"))%>","<%= trim(rs2("smallid"))%>"); <% count2 = count2 + 1 rs2.movenext loop rs2.close set rs2=nothing %> onecount2=<%=count2%>; function changelocation2(smalltypesid) { document.f1.smalltypes.length = 0; var smalltypesid=smalltypesid; var j; document.f1.smalltypes.options[0] = new option('--小类行业--',''); for (j=0;j < onecount2; j++) { if (subcat2[j][1] == smalltypesid) { document.f1.smalltypes.options[document.f1.smalltypes.length] = new option(subcat2[j][0], subcat2[j][2]); } } } </script> <select name="bigtypes" onchange="changelocation(document.f1.bigtypes.options[document.f1.bigtypes.selectedindex].value)" size="1"> <option selected value="">--------选择大类行业---------</option> <% sql1 = "select bigid,bigtypes from newbig order by bigid" set rs1 = conn.execute (sql1) do while not rs1.eof %> <option value="<%=trim(rs1("bigid"))%>"><%=trim(rs1("bigtypes"))%></option> <% rs1.movenext loop rs1.close set rs1 = nothing conn.close set conn=nothing %> </select></td> </tr> <tr bgcolor="e6e6e6"> <td width="101" height="35" align="center"><strong>行业中类</strong></td> <td width="349" height="35"><select name="middletypes" onchange="changelocation2(document.f1.middletypes.options[document.f1.middletypes.selectedindex].value)"> <option value="" selected>--------选择中类行业---------</option> </select></td> </tr> <tr bgcolor="e6e6e6"> <td width="101" height="35" align="center"><strong>行业小类</strong></td> <td width="349" height="35"><select name="smalltypes" size="1"> <option value="" selected>--------选择小类行业---------</option> </select></td> </tr> <tr bgcolor="e6e6e6"> <td width="101" height="35"> </td> <td width="349" height="35"><input type="submit" name="submit3" value=" 搜索 "> <input type="reset" name="submit5" value=" 重写 "></td> </tr> </table> </form> 编辑:黑鹰 [发送给好友] [打印本页] [关闭窗口] [返回顶部] 上一篇:如何实现任意支持格式的图片的缩放? <<========>> 谁来帮我完成1个图片缩放函数? 下一篇:一个简单的mysql数据库分页的程序模板(初学者进) 转载请注明来源:www.iyit.net 特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。 |
| 相关文章 | ||||
| 设置首 页 - 版权声明 - 广告服务 - 关于我们 - 联系我们 - 友情连接 |
| |||||||