SSH动态下拉列表实现?

[复制链接]
查看11 | 回复1 | 2011-4-19 11:17:27 | 显示全部楼层 |阅读模式
由ORACLE数据库中调出数据,然后再由一下下拉列表调出别外一个下拉列表,而且不是的!
一个下拉列表下还有一个下拉列表,且动态,以一个省,下面有哪几个城市为例,谁能帮我写出来。谢谢!
回复

使用道具 举报

千问 | 2011-4-19 11:17:27 | 显示全部楼层
<pre id=\"best-answer-content\" class=\"reply-text mb10\">额,用JQUERY实现,先导入JQUERY包

JS代码:
//选择大类触发的事件
function selectSmallCate() {
var id = $(\"#bigCateSelect\").val();
//根据大类的id获取小类列表
$.ajax({
type:\'post\',
url:\"admin/Book_getSmallCate\",//Action,返回Book_getSmallCate.jsp
data:\"bigCateId=\" id,
cache:false,
timeout:9000,
success:function(result){
$(\"#ajaxdiv\").html(result);
}
});
}

JSP页面的代码:
label大类:/label
s:select list=\"bigCateList\" listKey=\"cateId\" listValue=\"cateName\" name=\"bigCateId\" onchange=\"selectSmallCate();\"
id=\"bigCateSelect\" headerKey=\"-1\" headerValue=\"--请选择--\"/s:select
span/span
label小类:/label
span id=\"ajaxdiv\"/span


Book_getSmallCate.jsp页面主要代码
s:select list=\"smallCateList\" listKey=\"cateId\" listValue=\"cateName\"
name=\"smallCateId\" headerKey=\"-1\" headerValue=\"--请选择--\" theme=\"simple\" /s:select
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行