n级联动下拉菜单

菜单|下拉

<FORM name="isc">
<table border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td nowrap height="11">  

<select name="example" size="1" >
<option selected>---Select1-------------</option>
<option>Webmaster Sites</option>
<option>News Sites</option>
</select>

<select name="stage2" size="1" >
<option value=" " selected> </option>
<option value=" " selected>---Select2--------------</option>
<option value=" " selected>---Select2--------------</option>
</select>

<select name="stage3" size="1" >
<option value=" " selected> </option>
<option value=" " selected>---Select3----------------</option>
<option value=" " selected>---Select3----------------</option>
</select>

<script>
<!--

/*
Triple Combo Script Credit
By Hamid Cheheltani/ Website Abstraction (http://www.wsabstract.com)
Visit <A HREF="http://wsabstract.com" TARGET=_blank>wsabstract.com</A> for this and over 400+ other scripts
*/

var groups=document.isc.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()

group[0][0]=new Option("---Select2---"," ");

group[1][0]=new Option("Now Select This One"," ");
group[1][1]=new Option("JavaScript","47");
group[1][2]=new Option("DHTML","46");
group[1][3]=new Option("CGI","45");

group[2][0]=new Option("Now Select This One"," ");
group[2][1]=new Option("General News","115");
group[2][2]=new Option("Technology News","116");

var temp=document.isc.stage2

function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
redirect1(0)
}

var secondGroups=document.isc.stage2.options.length
var secondGroup=new Array(groups)
for (i=0; i<groups; i++) {
secondGroup[i]=new Array(group[i].length)
for (j=0; j<group[i].length; j++) {
secondGroup[i][j]=new Array() }}

secondGroup[0][0][0]=new Option("---Select 3---"," ");
secondGroup[1][0][0]=new Option("---Select 3---"," ");
secondGroup[1][1][0]=new Option("Now Select This One"," ");
secondGroup[1][1][1]=new Option("Website Abstraction","http://wsabstract.com");
secondGroup[1][1][2]=new Option("JavaScript for the non programmer","http://webteacher.com/javascript/");
secondGroup[1][1][3]=new Option("Java-Scripts.net","http://java-scripts.net");

secondGroup[1][2][0]=new Option("Now Select This One"," ");
secondGroup[1][2][1]=new Option("Dynamic Drive","http://www.dynamicdrive.com");
secondGroup[1][2][2]=new Option("Beginner\'s Guide to DHTML","http://www.geocities.com/ResearchTriangle/Facility/4490/");
secondGroup[1][2][3]=new Option("Web Coder","http://webcoder.com/");

secondGroup[1][3][0]=new Option("Now Select This One"," ");
secondGroup[1][3][1]=new Option("CGI Resources","http://www.cgi-resources.com");
secondGroup[1][3][2]=new Option("Ada\'s Intro to CGI","http://adashimar.hypermart.net/");

secondGroup[2][0][0]=new Option("---Select 3---"," ");
secondGroup[2][1][0]=new Option("Now Select This One"," ");
secondGroup[2][1][1]=new Option("CNN","http://www.cnn.com");
secondGroup[2][1][2]=new Option("MSNBC","http://www.msnbc.com");
secondGroup[2][1][3]=new Option("ABC News","http://www.abcnews.com");

secondGroup[2][2][0]=new Option("Now Select A Page"," ");
secondGroup[2][2][1]=new Option("News.com","http://www.news.com");
secondGroup[2][2][2]=new Option("Wired","http://www.wired.com");

var temp1=document.isc.stage3
function redirect1(y){
for (m=temp1.options.length-1;m>0;m--)
temp1.options[m]=null
for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
}
temp1.options[0].selected=true
}

function redirect2(z){
window.location=temp1[z].value
}

//-->
</script>

  </td>
</tr>
</table>
</FORM>

<p><font face="arial" size="-2">This free script provided by</font><br>
<font face="arial, helvetica" size="-2"><a href="http://wsabstract.com">Website
Abstraction</a></font></p>

时间: 2024-10-22 22:18:04

n级联动下拉菜单的相关文章

ThinkPHP使用心得分享-ThinkPHP + Ajax 实现2级联动下拉菜单_php技巧

首先是数据库的设计.分类表叫cate. 我做的是分类数据的二级联动,数据需要的字段有:id,name(中文名),pid(父id). 父id的设置: 若数据没有上一级,则父id为0,若有上级,则父id为上一级的id. 数据库有内容后,就可以开始写代码,进行二级联动的实现. 先在后台php获取所有pid为0的数据,保存到$cate中,然后在第一层的<select>中用foreach循环输出. Html代码: 复制代码 代码如下: <select name="type" s

自定义select皮肤的三级联动下拉菜单

 代码如下 复制代码 <!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> <title>自定义select皮

php 如何用smarty代码实现二级联动下拉菜单

问题描述 php 如何用smarty代码实现二级联动下拉菜单 在一页面上,如何实现选中一个下拉菜单,同步更新另外一个下拉菜单的值?

PHP地区二级联动下拉菜单代码

<?php header('Content-Type: application/json; charset=utf-8'); echo 'province=[];'; foreach ($arrProvinces as $province) { echo 'province.push(['.$province['ProvinceID'].',"'.$province['ProvinceName'].'"]);'; } echo 'city=[];'; foreach ($arrC

ajax+php无刷新二级联动下拉菜单(省市联动)源码

ajax.js /** * ajax无刷新二级联动下拉菜单(省市联动) * * @author arcow <arcow@126.com> * @version 1.0 * @lastupdate 2005-12-29 * */ var http_request = false; function send_request(url,method) {//初始化.指定处理函数.发送请求的函数 http_request = false; //开始初始化XMLHttpRequest对象 if(win

Excel怎么设置二级联动下拉菜单?

  Excel怎么设置二级联动下拉菜单?在excel里制作下拉菜单有好几种方法,我主要介绍下用数据有效性设置下拉菜单及怎么设置二级联动下拉菜单.这两种方法我将均以例子说明. 一.用数据有效性设置下拉菜单 例:如下图所示,要求在销售员一列设置可以选取的下拉菜单. 步骤1:选取销售员一列需要设置下拉菜单的单元格区域(这一步不能少),打开数据有效性窗口(excel2003版数据菜单 - 有效性,excel2007和2010版本 数据选项卡 - 数据有效性 - 数据有效性),在窗口中的"设置"

javascript支持区号输入的省市二级联动下拉菜单_javascript技巧

省市二级联动下拉菜单,增加了区号输入.多组选项共用一组数据. 选择地区,可以获取区号,填写区号自动选取地区. 某些地市的区号收集中. 省份选择城区 省份选择城区 [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

用以下代码实现的三级联动下拉菜单[调用数据库数据],没有显示菜单内容,帮我看看是哪里出问题了?谢谢!

问题描述 用以下代码实现的三级联动下拉菜单[调用数据库数据],没有显示菜单内容,帮我看看是哪里出问题了?谢谢! 三个表: P_BigClass(字段:BigClassID,BigClassName,descid), P_SmallClass(字段:SmallClassID,BigClassName,SmallClassName,descid), P_Sales(字段:SalesID,SmallClassName,SalesName,descid) var arrSel=["BigClassNam

地区选择-WAP地区3级联动下拉框怎么做?

问题描述 WAP地区3级联动下拉框怎么做? WAP地区3级联动下拉框怎么做?如图: 请指教~ 解决方案 http://zhidao.baidu.com/link?url=g-rBqdj52Sg9tfnVZ5SNqKEpe8W4dvMVJNSEYv3IbjTysTCtv9C_oXGIVwVOlaluWM40pn7ihXtm9plTbeUfEAL3zaGeFxeKniNTp3zB-Y_