类似下拉列表框的联动效果,比如选择一个下拉框的option,第二个下拉列表就自动加载该选项的子选项option,我要做的不是下拉框的这种,我要用复选框(checkbox)做多项选择,不管选中哪一项(可以多选)都要在下一级列表显示出被选中的checkbox的子项内容,并且子项也是checkbox,也可以多选。提交表单的时候要能获取到被选中的checkbox的值.可以到http://www.foodqs.com看看,用户名:b4ys 密码:3065。效果位置:商业机会/发布商机,下拉框换成复选框,这个网站用的是iframe,在firefox下不支持,我想用div.我是菜鸟,请高手帮忙......例如:父级复选框:1.中国
2.德国
3.加拿大
......
n.美国
子级复选框:父级菜单没有选择是,这里没有复选框,如果选中1、2、3,3个父级复选框的话 就在此列出所有属于这三个国家的城市。
中国>>北京
中国>>上海
中国>>香港
德国>>柏林
加拿大>>多伦多
加拿大>>渥太华
加拿大>>蒙特利尔
2.德国
3.加拿大
......
n.美国
子级复选框:父级菜单没有选择是,这里没有复选框,如果选中1、2、3,3个父级复选框的话 就在此列出所有属于这三个国家的城市。
中国>>北京
中国>>上海
中国>>香港
德国>>柏林
加拿大>>多伦多
加拿大>>渥太华
加拿大>>蒙特利尔
解决方案 »
- 分享:支持web全局热键的jquery插件源码,仿office2007的alt键功能。
- 如何实现在IE内一张尺寸超过IE窗口的图片,鼠标在图上可以拖动图片查看,相当于IE滚动条功能。
- 请问为什么JQUERY在FF无效?
- 急:现在哪里可以下载JSVM优化的Ext for jsvm啊
- 这段js代码在IE中为什么报错?
- 用javascript有没有办法获取选中字体的大小、颜色等属性
- onbeforeunload 事件是不是不支持柜架页面?
- 急:救命!如何在纯HTML网页中查询xml数据
- 高手请进!如何动态的调用id??
- 如何在让本页最大化(已经完成)而且没有标题栏(没解决)
- 如何解决了网络无法连接时,的自定义提示框
- 在firefox下怎么获取iframe内某个Input的value
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>new page</title>
<script>
var cityArray=new Array();
cityArray[0]=["北京","上海","香港"];
cityArray[1]=["柏林"];
cityArray[2]=["多伦多","渥太华","蒙特利尔"];
function changeValue(value){
document.getElementById("s").innerHTML="";
var select=document.getElementById("s");
for(var i=0;i<cityArray[value].length;i++){
var option=new Option(cityArray[value][i],cityArray[value][i]);
select.options.add(option);
}
}
</script>
</head>
<body>
国家:<select onchange="changeValue(this.value)">
<option value="0">中国</option>
<option value="1">德国</option>
<option value="2">加拿大</option>
</select><br>
城市:<select id=s>
<option>北京</option>
<option>上海</option>
<option>香港</option>
</select>
</body>
</html>
checksb.type = "checkbox";
checksb.id = "mychecks";
document.getElementById("form1").appendChild(checksb);
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#Include file="Conn.inc"--><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>测试</title>
</head><body>
<Script language="javascript">
<!--
function checkCountry()
{
var div = document.createElement('div')
var input = document.createElement('input')
input.type = 'checkbox'
input.checked = true
div.appendChild(input)
document.body.appendChild(input)
//input.checked = true
}
var Country = document.getElementsByName('Country');
var StateDiv = document.getElementById('StateDiv');
var State = document.createElement('input');
State.type = "checkbox";
State.id = "States";
State = new Array();
var Countrys = new Array();
Country.type='checkbox';
var i;
for (i = 0; i<Country.length; i++)
{ Countrys[i] = Country[i].value;
if (Country[i].checked == true)
{
Countries=Countrys[i]
<%
Set Rs=Server.Createobject("adodb.recordset")
Sql="select * from States where Countries='"&Countries&"'"
Rs.open Sql,conn,1,1
Recordscount=Rs.recordcount
Do while Not rs.bof and Not rs.eof and J < Recordscount
%>
State[i][j]=<%=Rs("States")%>
document.body.appendChild(State);
<%
J=J+1
Rs.movenext
loop
%>
}
}
}
//-->
</Script><form name="shipping" id="shipping" method="post" action="1.asp?action=save">
<div id="CountryDiv" style="width:180px;height:160px;overflow:auto;border: 2px inset #FFFFFF;">
<%
Set Rs=Server.Createobject("adodb.recordset")
Sql="select * from Countries order by Countries asc"
Rs.open Sql,conn,1,1
Do while Not Rs.bof and Not Rs.eof
%>
<input type="checkbox" name="Country" id="Country" value="<%=Rs("Countries")%>" onclick="checkCountry()" border="1"/><%=Rs("Countries")%><br>
<%
Rs.movenext
loop
%>
</div>
<div id="StateDiv" style="width:180px;height:160px;overflow:auto;border: 2px inset #FFFFFF;">
</div>
</form>
</body>
</html>
[email protected]