[网页高手]
Homepage
[网络编程]
Programe
[图形图像]
Picture
[冲浪宝典]
Insernet
[操作系统]
System
[软件教学]
Software
[数码时代]
Didgtale
[安全防御]
Didgtale
[IT学院]
Education
    
 
Google Web tongyi.net
 
    你的位置:首页 > 网页高手 > HTML > 下拉框连动的小例子(.htm版)
网页高手
  Dreamweaver

FrontPage

Javascript

HTML

CSS

XML

心得技巧

DHTML

 
下拉框连动的小例子(.htm版)


< html >
< head >
< title >List< /title >
< meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
< script LANGUAGE="javascript" >
< !--
var onecount;
onecount=0;
    
subcat = new Array();
subcat[0] = new Array("徐汇区","01","001");
subcat[1] = new Array("嘉定区","01","002");
subcat[2] = new Array("黄浦区","01","003");
subcat[3] = new Array("南昌市","02","004");
subcat[4] = new Array("九江市","02","005");
subcat[5] = new Array("上饶市","02","006");

onecount=6;

function changelocation(locationid)
    {
    document.myform.smalllocation.length = 0; 

    var locationid=locationid;
    var i;
    document.myform.smalllocation.options[0] = new Option('====所有地区====','');
    for (i=0;i <  onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
            document.myform.smalllocation.options[document.myform.smalllocation.length]
 = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    

//-- >
< /script >
< /head >
< body >
< form name="myform" method="post" >
    < select name="biglocation" 
onChange="changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value)" >
        < option value="01" selected >上海< /option >
        < option value="02" >江西< /option >
    < /select >
    < select name="smalllocation" > 
        < option selected value="" >==所有地区==< /option >
    < /select >
< /form >
< script LANGUAGE="javascript" > 
< !-- 
    changelocation(document.myform.biglocation.options[document.myform.biglocation.selectedIndex].value); 
//-- > 
< /script >
< /body >
< /html >
     打印本文 | 推荐朋友 | 收藏文章 | 关闭窗口
 
 

    相关文章
 加密你的html源代码     (2001年10月18日)

 使页面上超级链接文本无下划线    (2001年9月17日)

 也为网页加一个“Loading”过渡    (2001年9月17日)

 HTML协议有漏洞,网民可能成“枪手”    (2001年9月17日)

 利用VB提取HTML文件中的EMAIL地址    (2001年9月17日)

 HTML文档中小meta的大作用    (2001年9月10日)

 解析HTML的增强标记    (2001年9月10日)

 如何在网页制作中用好表格    (2001年9月7日)

 
 

 

关于统一 | 联系合作 | 统一作品 | 版权申明 | 建站服务 | 更多说明
Copyright 2000-2003 Tongyi All rights reserved. 京ICP备05005608号