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

省市区三级联动下拉框+数据绑定

时间:2015-08-11 11:50:20      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:

1.视图代码

<select class="prov" id="prov5" name="Province" data-code="@Model.Province">
</select>
<select class="city" id="city5" name="City" data-code="@Model.City">
</select>
<select class="dist" id="area5" name="Area" data-code="@Model.Area">
</select>
@Html.HiddenFor(m => m.Province)
@Html.HiddenFor(m => m.City)
@Html.HiddenFor(m => m.Area)

2.JS调用

<script type="text/javascript">
var selectVa2 = new CitySelect({
data: data,
provId: "#prov5",
cityId: ‘#city5‘,
areaId: ‘#area5‘,
isSelect: true
});
</script>

3.引入的js

<script src="@Url.Content("~/Themes/Admin/JS/jquery-1.4.4.min.js")" type="text/javascript"></script>

<script src="@Url.Content("/Themes/Admin/JS/city2.js")" type="text/javascript"></script>
<script src="@Url.Content("/Themes/Admin/JS/citySelect2.js")" type="text/javascript"></script>

4.js插件下载地址

js插件下载地址:http://files.cnblogs.com/files/weishuanbao/%E7%9C%81%E5%B8%82%E5%8C%BA.rar

省市区三级联动下拉框+数据绑定

标签:

原文地址:http://www.cnblogs.com/weishuanbao/p/4720157.html

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