js简单实现HTML标签Select联动带跳转
<script src="Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
<FORM name="form5" id="form5" action="" method="post" target="_blank" onsubmit="document.charset='GB2312';return false">
<tr>
<td nowrap="nowrap" class="biao">查询</td>
<td><select id="domainNewHouse" name="domain" onChange="redirect2(this.options.selectedIndex)">
<option value="0" selected>区域</option>
<option value="1">江岸区</option>
<option value="2">江汉区</option>
<option value="3">硚口区</option>
<option value="4">东西湖区</option>
<option value="7">汉阳区</option>
<option value="8">武汉经开</option>
<option value="11">武昌区</option>
<option value="12">青山区</option>
<option value="13">洪山区</option>
<option value="15">东湖高新区</option>
<option value="14">江夏区</option>
<option value="5">黄陂区</option>
<option value="6">新洲区</option>
<option value="9">蔡甸区</option>
<option value="10">汉南区</option>
<option value="16">其他</option>
</select></td>
<td><select name="pian" id="pianqu" style="width:80px;">
<option value="" selected>片区</option></select>
<script src="Scripts/JScript1.js" type="text/javascript"></script>
</td>
<td><input name="" type="button" value="搜索" style="height:20px;" class="anlv" onclick="getTabUrl('shangpu')"/></td>
</tr></FORM>
var groups = document.form5.domain.options.length
var group = new Array(groups)
for (i = 0; i < groups; i++)
group[i] = new Array()
//江岸
group[1][0] = new Option('不限', '0');
group[1][1] = new Option('堤角谌家矶', '17');
group[1][2] = new Option('二七', '18');
group[1][3] = new Option('后湖', '19');
group[1][4] = new Option('蔡家田花桥', '20');
group[1][5] = new Option('永清黄浦', '21');
group[1][6] = new Option('三阳路', '22');
group[1][7] = new Option('台北路香港路', '23');
group[1][8] = new Option('江汉路大智路', '24');
group[1][9] = new Option('其他', '25');
//江汉
group[2][0] = new Option('不限', '0');
group[2][1] = new Option('杨汊湖', '26');
group[2][2] = new Option('复兴村常青', '27');
group[2][3] = new Option('唐家墩', '28');
group[2][4] = new Option('王家墩CBD', '29');
group[2][5] = new Option('西北湖', '30');
group[2][6] = new Option('武广万松园', '31');
group[2][7] = new Option('前进花楼', '32');
group[2][8] = new Option('其他', '33');
//桥口
group[3][0] = new Option('不限', '0');
group[3][1] = new Option('武胜路', '34');
group[3][2] = new Option('宝丰', '35');
group[3][3] = new Option('宗关', '36');
group[3][4] = new Option('汉西', '37');
group[3][5] = new Option('古田', '38');
group[3][6] = new Option('其他', '39');
//东西湖
group[4][0] = new Option('不限', '0');
group[4][1] = new Option('常青花园', '40');
group[4][2] = new Option('金银湖', '41');
group[4][3] = new Option('吴家山', '42');
group[4][4] = new Option('金银潭将军路', '43');
group[4][5] = new Option('其他', '44');
//汉阳
group[5][0] = new Option('不限', '0');
group[5][1] = new Option('鹦鹉大道钟家村', '52');
group[5][2] = new Option('王家湾七里庙', '53');
group[5][3] = new Option('四新', '54');
group[5][4] = new Option('黄金口琴断口', '55');
group[5][5] = new Option('其他', '56');
//武汉经开
group[6][0] = new Option('不限', '0');
group[6][1] = new Option('沌口片', '57');
group[6][2] = new Option('其他', '58');
//武昌
group[7][0] = new Option('不限', '0');
group[7][1] = new Option('徐东', '62');
group[7][2] = new Option('岳家嘴', '63');
group[7][3] = new Option('水果湖', '64');
group[7][4] = new Option('积玉桥', '65');
group[7][5] = new Option('中南丁字桥', '66');
group[7][6] = new Option('小东门', '67');
group[7][7] = new Option('司门口', '68');
group[7][8] = new Option('阅马场首义', '69');
group[7][9] = new Option('武泰闸', '70');
group[7][10] = new Option('南湖花园', '71');
group[7][11] = new Option('其他', '72');
//青山
group[8][0] = new Option('不限', '0');
group[8][1] = new Option('建二', '73');
group[8][2] = new Option('红钢城', '74');
group[8][3] = new Option('其他', '75');
//洪山
group[9][0] = new Option('不限', '0');
group[9][1] = new Option('珞狮街道口', '76');
group[9][2] = new Option('卓刀泉虎泉', '77');
group[9][3] = new Option('南湖', '78');
group[9][4] = new Option('白沙洲', '79');
group[9][5] = new Option('黄家湖', '80');
group[9][6] = new Option('杨春湖', '81');
group[9][7] = new Option('其他', '82');
//东湖高新
group[10][0] = new Option('不限', '0');
group[10][1] = new Option('鲁巷', '88');
group[10][2] = new Option('关山', '89');
group[10][3] = new Option('大学科技园', '90');
group[10][4] = new Option('藏龙岛', '91');
group[10][5] = new Option('花山', '92');
group[10][6] = new Option('其他', '93');
//江夏
group[11][0] = new Option('不限', '0');
group[11][1] = new Option('流芳', '83');
group[11][2] = new Option('纸坊', '84');
group[11][3] = new Option('庙山', '85');
group[11][4] = new Option('大桥', '86');
group[11][5] = new Option('其他', '87');
//黄陂
group[12][0] = new Option('不限', '0');
group[12][1] = new Option('前川', '45');
group[12][2] = new Option('盘龙城', '46');
group[12][3] = new Option('武湖', '47');
group[12][4] = new Option('其他', '48');
//新洲
group[13][0] = new Option('不限', '0');
group[13][1] = new Option('新洲城区', '49');
group[13][2] = new Option('阳逻', '50');
group[13][3] = new Option('其他', '51');
//蔡甸
group[14][0] = new Option('不限', '0');
group[14][1] = new Option('蔡甸', '59');
group[14][2] = new Option('其他', '60');
//汉南
group[15][0] = new Option('汉南', '61');
//其他
group[16][0] = new Option('其他区域', '94');
var temp = document.form5.pian
function redirect2(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
}
var bDomainId = 0;
var sDomainId = 0;
function getTabUrl(shangpu) {
bDomainId = $("#domainNewHouse").val();
sDomainId = $("#pianqu").val();
window.open("http://***.com.cn/houselist_" + bDomainId + "_" + sDomainId + "_0_0_0_0_0_0__2_2_1.html");
}