您的位置:首页 > Web前端 > JQuery

JQuery cxSelect联动下拉菜单

2016-07-26 09:03 525 查看
<script type="text/javascript">
$(function () {

$.cxSelect.defaults.url = '${ctx!""}/resources/plugins/jQuery.cxSelect-1.4.0/js/cityData.min.json';
$.cxSelect.defaults.emptyStyle = 'none';
$('#city_china').cxSelect({
selects: ['province', 'city', 'area']
});
$('#submitRequirement').click(function () {
alert("fd");
});
});
</script>

<div class="form-group" id="city_china">
<p>省份:<select class="province">
<option>请选择</option>
</select></p>
<p>城市:<select class="city">
<option>请选择</option>
</select></p>
<p>地区:<select class="area">
<option>请选择</option>
</select></p>
</div>

INSERT INTO sys_city(province_id, name)
SELECT sys_province.province_id, hat_city.city FROM sys_province, hat_city, hat_province WHERE sys_province.`name` = hat_province.province
and hat_province.provinceID = hat_city.father;

INSERT INTO sys_district(province_id, city_id, name)
SELECT sys_city.province_id, sys_city.city_id, hat_area.area FROM sys_city, hat_city, hat_area WHERE sys_city.`name` = hat_city.city
and hat_city.cityID = hat_area.father;
http://code.ciaoca.com/jquery/cxSelect/ http://my.oschina.net/zhengweishan/blog/402483?fromerr=sIPTmbtx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: