📄 一个二级联动下拉框的jsp实现 - 逍遥游 -- it博客-中国最具人气的it博客-赛迪网it人家园.htm
字号:
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-10-y-2007.html">2007年10月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-11-y-2007.html">2007年11月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-12-y-2007.html">2007年12月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-1-y-2008.html">2008年1月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-2-y-2008.html">2008年2月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-3-y-2008.html">2008年3月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-4-y-2008.html">2008年4月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-5-y-2008.html">2008年5月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-6-y-2008.html">2008年6月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-7-y-2008.html">2008年7月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-8-y-2008.html">2008年8月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-9-y-2008.html">2008年9月</A>
<LI><A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-m-10-y-2008.html">2008年10月</A>
</LI></UL></DIV><!--end archive--><!--begin search-->
<DIV class=box>
<H2>文章搜索</H2>
<FORM action=search.php? method=post><INPUT type=hidden value=2 name=step>
<INPUT type=hidden value=3900 name=authorid> <INPUT type=hidden value=S
name=sch_area>
<DIV class=text style="OVERFLOW: hidden; WIDTH: 100%"><LABEL><INPUT class=ip
size=15 name=keyword> <INPUT class=bt type=submit value=" Go " name=submit>
</LABEL></DIV></FORM></DIV><!--end search--></DIV>
<SCRIPT language=JavaScript>function upleft(id){ var obj = GE('bloglist'); var objs = obj.getElementsByTagName('li'); for (var i=0;i<objs.length;i++) { if (objs[i].lastChild.tagName == 'ULS') { if (objs[i].id==id) { if (objs[i].lastChild.style.display != 'none') { objs[i].lastChild.style.display = 'none'; } else { objs[i].lastChild.style.display = ''; } } else { objs[i].lastChild.style.display = 'none'; } } }}function cgpic(aid){ var obj = GE('photo_img'); var obja = obj.getElementsByTagName('a'); var objimg = obja[0].getElementsByTagName('img'); var newaid = GE(aid).src; if (GE(aid).src) { newaid = newaid.replace(/\_thumb/ig,''); if (objimg[0].src=='' || objimg[0].src != newaid) { objimg[0].src = newaid; } if (obja[0].href != objimg[0].src) { obja[0].href = objimg[0].src; } } return;}function externallinks() { if (!document.getElementsByTagName) { return; } var obja = document.getElementsByTagName("a"); for (var i=0; i<obja.length; i++) { var obj = obja[i]; if (obj.getAttribute("href") && obj.getAttribute("rel") == "external") { obj.target = "_blank"; } }}</SCRIPT>
<!--begin main-->
<DIV class=right id=main>
<DIV class=box>
<H2>日志文章</H2><!--begin-->
<DIV class=text>
<DIV style="MARGIN-TOP: -10px; FLOAT: right"><IMG
src="一个二级联动下拉框的jsp实现 - 逍遥游 -- IT博客-中国最具人气的IT博客-赛迪网IT人家园.files/ncopy.jpg"></DIV>
<DIV style="MARGIN-TOP: -10px; FLOAT: right"><IMG height=40
src="一个二级联动下拉框的jsp实现 - 逍遥游 -- IT博客-中国最具人气的IT博客-赛迪网IT人家园.files/recommend.gif"
width=40></DIV>
<DIV class=gray>2006年01月14日 11:43:11</DIV>
<H3>一个二级联动下拉框的jsp实现 </H3>
<TABLE class=blog-content>
<TBODY>
<TR>
<TD>
<P><%@ page contentType="text/html; charset=gb2312" language="java"
errorPage=""
%><BR><html><BR><head><BR><title>无标题文档</title><BR><script
language="JavaScript" type="text/JavaScript"><BR>var onecount;
<BR>onecount=0; <BR>subcat = new Array(); <BR><%
<BR>
Dao da =
new Dao();<BR>
List smalllist = da.listObjs("from ProductSmallsort
as c where c.active='Y' ");
<BR>
if(smalllist!=null){<BR>
for(int
j=0;j<smalllist.size();j++){<BR>
ProductSmallsort pb = (ProductSmallsort)
smalllist.get(j);<BR>
if (pb !=
null) {<BR>%><BR>subcat[<%=j %>] = new Array("<%=
pb.getName()%>","<%=pb.getSmallsortid()%>","<%=
pb.getProductBigsort().getBigsortid() %>"); <BR><% }} %>
<BR>onecount=<%=smalllist.size() %>; <BR><% }
%><BR><!--决定select显示的函数--> <BR>function changelocation(id)
<BR> { <BR> document.myform.smallid.length = 0; <BR> var
locationid=id; <BR> var i; <BR>
document.myform.smallid.options[0] = new Option('请选择产品小类','0');<BR>
for (i=0;i<onecount;i++) <BR> { <BR>
if (subcat<I>[2] == locationid) <BR> {
<BR>
document.myform.smallid.options[document.myform.smallid.length] = new
Option(subcat<I>[0],subcat<I>[1]); <BR> }
<BR> } <BR> }
<BR></script><BR><meta http-equiv="Content-Type"
content="text/html;
charset=gb2312"></head><BR><BR><body><BR><form action=""
method="post" name="myform"><BR><table width="100%"
><BR><tr><BR> <td width="20%"
align="right">大类:</td><BR> <td><BR>
<select name="bigid"
onChange="changelocation(document.myform.bigid.options[document.myform.bigid.selectedIndex].value)"><BR>
<option value="0" selected>请选择产品大类</option><BR><%
<BR>
Dao dao = new Dao();<BR>
List biglist =
dao.listObjs("from ProductBigsort as c where c.active='Y' ");
<BR>
if(biglist!=null){<BR>
for(int
i=0;i<biglist.size();i++){<BR>
ProductBigsort yy = (ProductBigsort) biglist.get(i);<BR>
if (yy != null) {<BR>%><BR>
<option value="<%=yy.getBigsortid() %>"><%=yy.getName()
%></option> <BR><% }}} %><BR>
</select><BR>
</td><BR></tr><BR><tr><BR> <td width="20%"
align="right">小类:</td><BR> <td><BR>
<% <BR> /*如果是修改的话,是这样的<BR> <select
name="smallid">
<BR>
<% if(smallid!=0&bigid!=0){ %><BR> <option
value="<%= smallid %>" selected><%= smallName
%></option><BR> <% } %><BR>
</select> <BR> */<BR>
%><BR> <select name="smallid" ><BR>
<option value="0" selected>请选择产品小类</option>
<BR> </select><BR>
</td><BR></tr><BR></table><BR></form><BR></body><BR></html><BR></P></I></I></I></TD></TR></TBODY></TABLE>
<DIV class=bb>
<DIV>类别: <A
href="http://blog.ccidnet.com/blog-htm-do-list-uid-3900-type-blog-dirid-712.html">观注java技术</A>
| <A
href="http://blog.ccidnet.com/blog-htm-do-showone-uid-3900-type-blog-itemid-18378.html#c">评论</A>(<SPAN
id=sum>3</SPAN>) | <A
href="http://blog.ccidnet.com/blog-htm-do-showone-uid-3900-type-blog-itemid-18378.html">浏览</A>(3940)
| <A title=加入书签 style="CURSOR: pointer"
onclick="addtoclt(18378,'blog');">收藏</A></DIV>
<DIV class=c></DIV></DIV><!--begin comment--><A name=mao></A>
<DIV class="comment bb">
<H5 id=cdisplay style="DISPLAY: none">一共有 <SPAN id=sums>3</SPAN> 条评论</H5><SPAN
id=ajaxreply><A name=c0></A>
<SCRIPT> var commentIds = new Array(); </SCRIPT>
<SCRIPT> commentIds.push('114119');</SCRIPT>
<A name=c114119></A>
<DL id=114119>
<DD class="comment-pic left"><IMG
src="一个二级联动下拉框的jsp实现 - 逍遥游 -- IT博客-中国最具人气的IT博客-赛迪网IT人家园.files/none.jpg"
width=40>
<DD><SPAN style="FONT-WEIGHT: bolder; FONT-SIZE: 12px">3楼 </SPAN><A
class="big b"
href="http://blog.ccidnet.com/blog-htm-do-showone-uid-3900-type-blog-itemid-18378.html#">[匿名]guest</A>
<SPAN class=gray>2006年12月21日 17:52:36</SPAN> Says: </DD>
<DD class=comment-content>
<DIV>能不能把例子的源代码传上来呀,我急用这个。谢谢了。</DIV></DD></DL>
<SCRIPT> commentIds.push('67724');</SCRIPT>
<A name=c67724></A>
<DL id=67724>
<DD class="comment-pic left"><IMG
src="一个二级联动下拉框的jsp实现 - 逍遥游 -- IT博客-中国最具人气的IT博客-赛迪网IT人家园.files/none.jpg"
width=40>
<DD><SPAN style="FONT-WEIGHT: bolder; FONT-SIZE: 12px">2楼 </SPAN><A
class="big b"
href="http://blog.ccidnet.com/blog-htm-do-showone-uid-3900-type-blog-itemid-18378.html#">[匿名]guest</A>
<SPAN class=gray>2006年07月21日 10:54:49</SPAN> Says: </DD>
<DD class=comment-content>
<DIV>现在用ajax的也比较多</DIV></DD></DL>
<SCRIPT> commentIds.push('41359');</SCRIPT>
<A name=c41359></A>
<DL id=41359>
<DD class="comment-pic left"><IMG
src="一个二级联动下拉框的jsp实现 - 逍遥游 -- IT博客-中国最具人气的IT博客-赛迪网IT人家园.files/none.jpg"
width=40>
<DD><SPAN style="FONT-WEIGHT: bolder; FONT-SIZE: 12px">1楼 </SPAN><A
class="big b"
href="http://blog.ccidnet.com/blog-htm-do-showone-uid-3900-type-blog-itemid-18378.html#">[匿名]guest</A>
<SPAN class=gray>2006年01月18日 10:49:03</SPAN> Says: </DD>
<DD class=comment-content>
<DIV>我也写了连动的东西,在Struts中的。觉得这玩意儿是够烦的。<BR>建议兄弟用Tag改写,不论是从代码阅览和维护的角度,都会好多<BR><BR>ArdorLeo<BR></DIV></DD></DL></SPAN><INPUT
id=commentid type=hidden value=41359 name=commentid>
<DIV class=big id=commentspage></DIV>
<FORM name=FORM>
<DIV class=post-comment>
<H5>发表评论</H5>
<DIV><A>用户名:</A><INPUT class=ip id=guestname tabIndex=1 size=22 name=guestname>
</DIV>
<DIV><TEXTAREA class=ip id=content onkeydown=quickpost(event) style="WIDTH: 95%" tabIndex=4 name=content rows=10></TEXTAREA>
</DIV>
<DIV><IMG id=ck style="CURSOR: pointer"
onclick="javascript:newgdcode(ck,'ck.php?windid=guest');" alt=看不清楚,换一张 src=""
align=absMiddle> <INPUT class=ip id=gdcode tabIndex=1 size=4 name=gdcode> <INPUT
id=ifcode type=hidden value=guest> <INPUT class=bt id=csubmit onclick=postcomment(); tabIndex=5 type=button value="提 交" name=Submit valign="middle">
</DIV></DIV></FORM>
<SCRIPT language=JavaScript>var now = new Date();var ny = now.getYear();var nm = parseInt(now.getMonth())+1;nm = nm.toString();nm = LenthByByte(nm) < 2 ? '0' + nm : nm;var nd = now.getDate();var actdo = 'showone';var nextid = '114120';var nexturl = '#';var nextdate = ny + '年' + nm + '月' + nd + '日';var nexticon = 'image/upload/none.gif';var allow = '0';var type = 'blog';</SCRIPT>
<DIV class=c></DIV></DIV><!--begin comment--></DIV><!--end--></DIV></DIV><!--end main--><BR
class=c></DIV><!--<script language="JavaScript" src="http://image.ccidnet.com/ad_files/home_daohang/copyright_1128.js"></script>--></DIV></DIV></DIV>
<SCRIPT language=javascript src=""></SCRIPT>
<!-- ccidnet -->
<SCRIPT language=JavaScript type=text/javascript> var _PCSWebSite="100001"; var _PCSImage="countlogo1.gif";</SCRIPT>
<SCRIPT language=JavaScript
src="一个二级联动下拉框的jsp实现 - 逍遥游 -- IT博客-中国最具人气的IT博客-赛迪网IT人家园.files/count.js"
type=text/javascript></SCRIPT>
<!-- ccidnet --></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -