页面省市区级联加载

<tr>
<td align="right">所在省:</td>
<td>
<select id="unitProvince" name="unitProvince" onchange="selectCompanyAddress2();selectCompanyAddress3();">
<option value=" " selected="selected">请选择所在省份</option>
</select>
</td>
<td align="right" valign="middle">所在市:</td>
<td>
<select id="unitCity" name="unitCity" onchange="selectCompanyAddress3()">
</select>
</td>
</tr>
<tr>
<td align="right" >所在区:</td>
<td>
<select id="unitStreat" name="unitStreat">
</select>
</td>
<td align="right">详细地址:</td>
<td>
<input type="text" id="unitAddress" name="unitAddress">
</td>
</tr>

//js代码================

function selectCompanyAddress1(){
var url='<%=basePath%>xyData/dict/LoadChildSellect.do?fid=';
HydUtilLoadChildSellect(url,$("#unitProvince"),"99996","");
}
function selectCompanyAddress2(){
var url='<%=basePath%>xyData/dict/LoadChildSellect.do?fid=';
HydUtilLoadChildSellect(url,$("#unitCity"),"99996",$("#unitProvince").val());
}
function selectCompanyAddress3(){
var url='<%=basePath%>xyData/dict/LoadChildSellect.do?fid=';
if(null!=$("#unitProvince").val() && ""!=$("#unitProvince").val()) {

//查询字典获取内容
HydUtilLoadChildSellect(url, $("#unitStreat"), "99996", $("#unitCity").val());
}
}

posted @ 2020-01-12 13:03  红尘沙漏  阅读(224)  评论(0编辑  收藏  举报