MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » jsp三级联动加数据库的一些有关问题(急)

jsp三级联动加数据库的一些有关问题(急)(7)

www.MyException.Cn  网友分享于:2013-12-13  浏览:203次

dsy.add("0_6_8",["赤水市","道真仡佬族苗族自治县","凤冈县","仁怀市","绥阳县","桐梓县","务川仡佬族苗族自治县","习水县","余庆县","正安县","遵义市","遵义县","湄潭县"]);


dsy.add("0_30",["重庆"]);
dsy.add("0_30_0",["城口县","大足县","垫江县","丰都县","奉节县","合川市","江津市","开县","梁平县","南川市","彭水苗族土家族自治县","荣昌县","石柱土家族自治县","铜梁县","巫山县","巫溪县","武隆县","秀山土家族苗族自治县","永川市","酉阳土家族苗族自治县","云阳县","忠县","重庆市","潼南县","璧山县","綦江县"]);
//-->
</SCRIPT>
<SCRIPT LANGUAGE = JavaScript>
<!--
//** Power by Fason(2004-3-11)
//** Email:fason_pfx@hotmail.com

var s=["s1","s2","s3"];
var opt0 = ["省份","地级市","市、县级市、县"];
function setup()
{
 for(i=0;i<s.length-1;i++)
document.getElementById(s[i]).onchange=new Function("change("+(i+1)+")");
 change(0);
}
//-->
</SCRIPT>
</head>
<body bgcolor="#E0E0E0" onload="setup()">
多级关联菜单:
<form name="frm">
<select id="s1"><option>省份</option></select>
<select id="s2"><option>地级市</option></select>
<select id="s3"><option>市、县级市、县</option></select>
</form>

</body>
</html>
------解决方案--------------------
太多了看了晕汗
------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" 

/> 
<title>级联显示 </title> 
<script> 
function change(){ 
var xzqhid=document.all.address.options

[document.all.address.selectedIndex].value; 
var user=document.all.user; 
var tel=document.all.tel; 
var userAll=document.all.userAll; 
var telAll=document.all.telAll; 

for(i=user.options.length-1;i>=0;i--)
{
user.options.remove(i);
}

for(i=tel.options.length-1;i>=0;i--)
{
tel.options.remove(i);
}
  
if(parseInt(xzqhid)==0){ 
return; 

user.add(new Option("---选择人员---",0)); 
for(var i=0;i <userAll.options.length;i++) 

if(userAll.options[i].addressid==xzqhid) 

user.add(new Option(userAll.options[i].text,userAll.options

[i].value)); 
}


  
function changeUser(){ 
var userid=document.all.user.options

[document.all.user.selectedIndex].value; 
var tel=document.all.tel; 
var telAll=document.all.telAll; 

for(i=tel.options.length-1;i>=0;i--)
{
tel.options.remove(i);

if(parseInt(userid)==0){ 
return; 

for(var i=0;i <telAll.options.length;i++) 

if(telAll.options[i].userid==userid) 

tel.add(new Option(telAll.options[i].text,telAll.options[i].value)); 

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有