如何实现啊??第一个下拉框中比如说是天津,北京 第二个下拉框中是南开,丰台,和平,通州。这些都是从数据库中查出的数据。如何点天津能调用方法查询出数据中的关联的数据呢。用JavaScript实现就行
解决方案 »
- Cannot create PoolableConnectionFactory (Io 异常: The Network Adapter could not e
- 问一下关于jquery一个简单问题,刚学这个。
- 帮我看看这是什么错误,
- ajxa如何实现,急想知道答案。
- 关于SQL存储过程的问题 急啊!!!
- javamail
- 异常
- 如何动态得到form表名
- 用eclipse+tomcat+lomzob,每建一个工程都要手动去更改TOMCAT的server.xml文件
- 如何设置[tomcat]无论访问那个目录都自动找当前目录下的index.jsp或index.htm等等。
- 关于Struts action之间redirect跳转,数据传递的问题
- eclipse+tomcat 连接数据库问题
2 struts的doubleselect标签
var select1_len = document.getElementById('s1').options.length;
var select2 = new Array(select1_len);
for (i=0; i<select1_len; i++) {
select2[i] = new Array();
}
select2[0][0] = new Option("请选择", "");
<logic:iterate id="el" name="list2" indexId="index1">
<logic:iterate id="element" name="el" indexId="index2">
select2[${index1} + 1][${index2}] = new Option("${element.name }", "${element.id }");
</logic:iterate>
</logic:iterate>//联动函数
function redirec(x) {
var temp = document.getElementById('s2');
temp.length = 0;
if(select2[x].length == 0){
temp.options[0] = new Option("没有此类对应的2级类别", "");
return;
}
for (i=0; i<select2[x].length; i++) {
temp.options[i] = new Option(select2[x][i].text, select2[x][i].value);
}
temp.options[0].selected = true;
}
</script>只是习惯编写,例子就不发了。自己领悟