jQuery select表单提交省市区城市三级联动,引用的是“jquery-1.7.min”类库,地区码查询地区名用数组存在AreaData_min,下面摘要部分代码: SelectArea.htm文件 复制代码 代码如下: jQuery select表单提交省市区城市三级联动 <BR>$(function (){ <BR>initComplexArea('seachprov', 'seachcity', 'seachdistrict', area_array, sub_array, '44', '0', '0'); <BR>}); <br><br>//得到地区码 <BR>function getAreaID(){ <BR>var area = 0; <BR>if($("#seachdistrict").val() != "0"){ <BR>area = $("#seachdistrict").val(); <BR>}else if ($("#seachcity").val() != "0"){ <BR>area = $("#seachcity").val(); <BR>}else{ <BR>area = $("#seachprov").val(); <BR>} <BR>return area; <BR>} <br><br>function showAreaID() { <BR>//地区码 <BR>var areaID = getAreaID(); <BR>//地区名 <BR>var areaName = getAreaNamebyID(areaID) ; <BR>alert("您选择的地区码:" + areaID + " 地区名:" + areaName); <BR>} <br><br>//根据地区码查询地区名 <BR>function getAreaNamebyID(areaID){ <BR>var areaName = ""; <BR>if(areaID.length == 2){ <BR>areaName = area_array[areaID]; <BR>}else if(areaID.length == 4){ <BR>var index1 = areaID.substring(0, 2); <BR>areaName = area_array[index1] + " " + sub_array[index1][areaID]; <BR>}else if(areaID.length == 6){ <BR>var index1 = areaID.substring(0, 2); <BR>var index2 = areaID.substring(0, 4); <BR>areaName = area_array[index1] + " " + sub_array[index1][index2] + " " + sub_arr[index2][areaID]; <BR>} <BR>return areaName; <BR>} <BR> 请选择省市地区: 程序下载地址: jquery select表单提交省市区城市三级联动 效果图: