|
主题:[建议]7.0中商品中归属栏目。能否改成多级联动 这样很方便 [收藏主题] | 转到: |
向我们的分类一般是3级。每个分类里的小分类都很多。尤其是第3级分类。内容很多相似的。 所以的在添加商品的时候,经常弄错弄混。如果否改成多级联动 这样很方便!分类一目了然。
下面是我原来的程序 后台代码 : <script language = "JavaScript"> var onecount; var threecount; onecount=0; threecount=0 subcat3=new Array(); <% count = 0 do while not rs2.eof %> subcat3[<%=count%>] = new Array("<%= trim(rs2("ssname"))%>","<%= rs2("scid")%>","<%= rs2("ssid")%>"); <% count = count + 1 rs2.movenext loop rs2.close %> threecount=<%=count%>; subcat = new Array(); <% count = 0 do while not rs.eof %> subcat[<%=count%>] = new Array("<%= trim(rs("scname"))%>","<%= rs("bcid")%>","<%= rs("scid")%>"); <% count = count + 1 rs.movenext loop rs.close %> onecount=<%=count%>; function changelocation(locationid) { document.myform.scid.length = 0; var locationid=locationid; var i; for (i=0;i < onecount; i++) { if (subcat[i][1] == locationid) { document.myform.scid.options[document.myform.scid.length] = new Option(subcat[i][0], subcat[i][2]); } } changelocation3(document.myform.scid.options[document.myform.scid.selectedIndex].value) } function changelocation3(locationid) { document.myform.ssid.length = 0; var locationid=locationid; var i; for (i=0;i < threecount; i++) { if (subcat3[i][1] == locationid) { document.myform.ssid.options[document.myform.ssid.length] = new Option(subcat3[i][0], subcat3[i][2]); } } } //--> </script> ----------------------------- 大类: <% rs.open "select * from bigclass order by paixu",conn,1,1 if rs.eof and rs.bof then response.write "请先添加分类" response.end else %> <select name="bcid" size="1" id="select2"> <option selected value="<%=trim(rs("bcid"))%>"><%=trim(rs("bcname"))%></option> <% dim selclass selclass=rs("bcid") rs.movenext do while not rs.eof %> <option value="<%=trim(rs("bcid"))%>"><%=trim(rs("bcname"))%></option> <% rs.movenext loop end if rs.close %> </select> 小类: <select name="scid" size="1" id="scid"> <% rs.open "select * from smallclass where bcid="&selclass,conn,1,1 if not(rs.eof and rs.bof) then dim selclass3 selclass3=rs("scid") do while not rs.eof %> <option value="<%=trim(rs("scid"))%>"><%=trim(rs("scname"))%></option> <% rs.movenext loop end if rs.close set rs = nothing %> </select> 子类: <select name="ssid"> <% rs2.open "select * from ssclass where scid="&selclass3,conn,1,1 if not(rs2.eof and rs2.bof) then do while not rs2.eof%> <option value="<%=rs2("ssid")%>"<%if ssid=rs2("ssid") then %> selected <%end if%> ><%=rs2("ssname")%></option> <% rs2.movenext loop end if rs2.close set rs2= nothing %> </select> |
|
支持(0) | 反对(0) 顶端 底部 |
支持(0) | 反对(0) 顶端 底部 |
支持(0) | 反对(0) 顶端 底部 |
<上一主题 | 下一主题 > |