主题:这个搜索功能,怎么替换,请高手帮看看这段程序?
小财神
[专家分:70] 发布于 2007-11-01 10:34:00
要做一个房子的搜索功能,但城市太多,而且要对应城市,这怎么弄,部分程序如下:
<FORM name=frmRegionSearch action="search_sell.asp" method=post target=_blank onSubmit="return checksearch()">
<tr>
<td ><div align="center">买卖</div></td>
<TD><SELECT style="WIDTH: 60px" onChange="cityChange(frmRegionSearch,'城市');" name=city><OPTION value=城市 selected>城市</OPTION></SELECT> </TD>
<TD><SELECT style="WIDTH: 60px" name=district> <OPTION value="" selected>行政区</OPTION></SELECT> </TD>
<TD><SELECT style="WIDTH: 60px" onchange=regionSearchChange(document.frmRegionSearch); name=housetype> <OPTION value=normal selected>住宅类</OPTION> <OPTION value=busi>商用类</OPTION> <OPTION value=plaza>写字楼</OPTION></SELECT> </TD>
<TD><SELECT style="WIDTH: 60px" name=price><OPTION value="" selected>价格</OPTION></SELECT> </TD>
<TD><SELECT style="WIDTH: 60px" name=area><OPTION value="" selected>面积</OPTION></SELECT> </TD>
<TD><INPUT name=key style="WIDTH: 60px" value="关键字"></TD>
<td><INPUT onclick=submitRegionForm(frmRegionSearch); type=button value=查询 name=cmdSearch></td>
</tr>
</FORM>
这里边有name=city,name=district,name=housetype,name=price,name=area,我想把他替换成name=search_city,name=search_qu,name=search_lx,name=search_jg,name=search_mj
这样才行,但当调用<SCRIPT language=javascript src="jsq/district.js"></SCRIPT>
这里边的,就不知道怎么弄了,district.js 内容如下
沙发
小财神 [专家分:70] 发布于 2007-11-01 10:37:00
function districtStruct(cityid, city, districtid, district)
{
this.cityid = cityid;
this.city = city;
this.districtid = districtid;
this.district = district;
}
function optionStruct(optionValue, optionText)
{
this.optionValue = optionValue;
this.optionText = optionText;
}
var arrCity = new Array();
var nCityIndex = 0;
var arrCityDistrict = new Array();
var nIndex = 0;
var arrSalePrice = new Array();
var arrSalePriceBusi = new Array();
var arrSalePricePlaza = new Array();
var arrRentPrice = new Array();
var arrRentPriceBusi = new Array();
var arrRentPricePlaza = new Array();
var arrArea = new Array();
arrCity[nCityIndex++] = "北京";
arrCity[nCityIndex++] = "厦门";
arrCity[nCityIndex++] = "郑州";
arrCity[nCityIndex++] = "温州";
arrCity[nCityIndex++] = "上海";
arrCity[nCityIndex++] = "广州";
arrCity[nCityIndex++] = "深圳";
arrCity[nCityIndex++] = "大连";
arrCity[nCityIndex++] = "宁波";
arrCity[nCityIndex++] = "杭州";
arrCity[nCityIndex++] = "青岛";
arrCity[nCityIndex++] = "天津";
arrCity[nCityIndex++] = "成都";
arrCity[nCityIndex++] = "福州";
arrCity[nCityIndex++] = "武汉";
arrCity[nCityIndex++] = "苏州";
arrCity[nCityIndex++] = "南京";
arrCity[nCityIndex++] = "长沙";
arrCity[nCityIndex++] = "济南";
arrCity[nCityIndex++] = "西安";
arrCity[nCityIndex++] = "石家庄";
arrCity[nCityIndex++] = "昆明";
arrCity[nCityIndex++] = "沈阳";
arrCity[nCityIndex++] = "潍坊";
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 0, "朝阳区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 1, "东城区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 2, "西城区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 3, "海淀区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 4, "丰台区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 5, "石景山区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 6, "崇文区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 7, "宣武区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 8, "通州区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 9, "房山区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 10, "大兴区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 11, "门头沟区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 12, "延庆县");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 13, "密云县");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 14, "怀柔区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 15, "平谷区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 16, "顺义区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 17, "昌平区");
arrCityDistrict[nIndex++] = new districtStruct(1, "北京", 18, "其它地区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 0, "厦门开元区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 1, "厦门思明区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 2, "厦门湖里区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 3, "厦门鼓浪屿区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 4, "厦门集美区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 5, "厦门杏林区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 6, "厦门同安区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 7, "厦门海沧区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 8, "泉州丰泽区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 9, "泉州洛江区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 10, "泉州鲤城区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 11, "泉州泉港区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 12, "厦门翔安区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 13, "泉州石狮区");
arrCityDistrict[nIndex++] = new districtStruct(2, "厦门", 14, "泉州晋江区");
arrCityDistrict[nIndex++] = new districtStruct(3, "郑州", 0, "金水区");
arrCityDistrict[nIndex++] = new districtStruct(3, "郑州", 1, "中原区");
arrCityDistrict[nIndex++] = new districtStruct(3, "郑州", 2, "二七区");
arrCityDistrict[nIndex++] = new districtStruct(3, "郑州", 3, "管城区");