首页 > Web开发 > 详细

chose.jquery 联动

时间:2016-10-28 03:10:20      阅读:254      评论:0      收藏:0      [点我收藏+]

<link href="~/Scripts/chosen/chosen.css" rel="stylesheet" />
<script src="~/Scripts/chosen/chosen.jquery.js"></script>

 <script type="text/javascript">

$(function () {
 

$("#ProvId").change(function(){
var citys = [];
console.log($(this).val());
console.log($("#CityId"));
$("#CityId").append("<option value=‘01‘ >广州</option>");
var obj = {};
$("#CityId").chosen();
});
});

 


</script>

 

<dt>省份</dt>
<dd>
@Html.DropDownList("ProvId", SdJobs.Controllers.HomeController.ProvinceList, "--请选择--", new { @class = "chosen-select-width input normal", @tabindex = "2" })

<span class="Validform_checktip"></span>

</dd>
<dt>城市</dt>
<dd>

<select id="CityId" class="chosen-select-width input normal" >
<option value="">--请选择--</option>
</select>

<span class="Validform_checktip"></span>

</dd>
<dt>县区</dt>
<dd>

<select id="CountyId" class="chosen-select-width input normal" >
<option value="">--请选择--</option>
</select>

<span class="Validform_checktip"></span>

</dd>

<script type="text/javascript">
var config = {
‘.chosen-select‘: {},
‘.chosen-select-deselect‘: { allow_single_deselect: true },
‘.chosen-select-no-single‘: { disable_search_threshold: 10 },
‘.chosen-select-no-results‘: { no_results_text: ‘Oops, nothing found!‘ },
‘.chosen-select-width‘: { width: "200%" }
}
for (var selector in config) {
$(selector).chosen(config[selector]);
}
</script>

chose.jquery 联动

原文:http://www.cnblogs.com/zhshlimi/p/6006189.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!