﻿<select name="{formName1}" id="selectMainSort" onChange="showSort(this.value)">
<option value="" selected="selected">请选择</option>
{addressList}
</select>
<select name="{formName2}" id="selectSort">
<option value="">请选择</option>
</select>
<script language="javascript">
function showSort(cityName)
{
	var cityStr="{cityStr}"
	var city=cityStr.split("|")
	selectBorough=document.getElementById("selectSort")
	if(cityName!=""){
		for(i=0;i<city.length;i++){
			selectBorough.style.width="0px"
			selectBorough.style.width="auto"
			arrayBorough=city[i].split(",")
			if(arrayBorough[0]==cityName){
				selectBoroughLangth=selectBorough.options.length
				/*删除地区的所有值*/
				for(t=0;t<selectBoroughLangth;t++){
					selectBorough.remove(0)
				}
				for(t=1;t<arrayBorough.length;t++){
					boroughOption=document.createElement("option")
					boroughOption.appendChild(document.createTextNode(arrayBorough[t]))
					boroughOption.setAttribute("value", arrayBorough[t]);
					selectBorough.appendChild(boroughOption)
				}
			}
		}
		
	}
	else{
		selectBoroughLangth=selectBorough.options.length
		/*删除地区的所有值*/
		for(t=0;t<selectBoroughLangth;t++){
			selectBorough.remove(0)
		}
		boroughOption=document.createElement("option")
		boroughOption.appendChild(document.createTextNode("请选择"))
		boroughOption.setAttribute("value", "")
		selectBorough.appendChild(boroughOption)
	}
}
</script>