码迷,mamicode.com
首页 > 其他好文 > 详细

页面省市区级联加载

时间:2020-01-12 15:27:40      阅读:108      评论:0      收藏:0      [点我收藏+]

标签:add   option   put   function   com   city   js代码   middle   ted   

<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());
}
}

页面省市区级联加载

标签:add   option   put   function   com   city   js代码   middle   ted   

原文地址:https://www.cnblogs.com/xianz666/p/12182458.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!