省市区三级联动(附j全国省市区json文件)
效果如图所示:

首先提供全国所有省份的JS文件
下载地址:https://files.cnblogs.com/files/likui-bookHouse/address.rar
打开js内容如下:

html代码:
<div class="easyui-panel" style="padding:10px;">
<form id="logisticPointForm" method="post">
<div>
<label>交接点:</label>
<input class="easyui-textbox" id="PointName" name="PointName" data-options="required:true" style="width:70%;">
</div>
<div>
<label>选择区域:</label>
<input class="easyui-combobox" id="Province" name="Province" style="width:22%" , data-options="prompt:'省',required:true,editable:false,">
<input class="easyui-combobox" id="City" name="City" style="width:22%" , data-options="prompt:'市',required:true,editable:false,">
<input class="easyui-combobox" id="County" name="County" style="width:22%" , data-options="prompt:'区/镇',required:true,editable:false,">
</div>
<div>
<label>详细地址:</label>
<input class="easyui-textbox" id="Address" name="Address" data-options="required:true" style="width:70%;">
</div>
<div>
<label>对方物流员:</label>
<input class="easyui-linkbutton" id="OppositeLogister" name="OppositeLogister" style="height:30px;" value="+选择物流员" onclick="sectionManageObj.choiceLogisterDialog(1)" />
<input id="OppositeLogisterId" name="OppositeLogisterId" type="hidden" />
</div>
<div>
<label>我方物流员:</label>
<input class="easyui-linkbutton" id="MyLogister" name="MyLogister" style="height:30px;" value="+选择物流员" onclick="sectionManageObj.choiceLogisterDialog(2)"/>
<input id="MyLogisterId" name="MyLogisterId" type="hidden"/>
</div>
<div>
<label>最晚交接时间:</label>
<!--<input class="easyui-datetimebox" id="LatestDate" name="LatestDate" style="width:30%" ,required:true, data-options="onShowPanel:function(){$(this).datetimebox('spinner').timespinner('setValue','00:00:00')}" >-->
<input class="easyui-timespinner" id="LatestDate" name="LatestDate" required="required" data-options="width:'30%',showSeconds:true">
</div>
<div style="text-align:center;">
<input href="#" class="easyui-linkbutton" value="取消" style="width:100px;height:30px;text-align:center;border-radius:5px;background:dimgray;color:white;" data-options="onClick:sectionManageObj.closeAddDialog">
<input href="#" class="easyui-linkbutton" value="确认" style="width:100px;height:30px;text-align:center;border-radius:5px;background:dodgerblue;color:white;" data-options="onClick:sectionManageObj.addSubmitDialog">
</div>
</form>
</div>
<style>
label {
display: inline-block;
width:80px;
}
#logisticPointForm div {
margin-top:10px;
margin-bottom:10px;
}
</style>
<script>
$('#LatestDate').datetimebox({
required : true,
onShowPanel:function(){
//设置为只能设置为时分秒的选择器
$(this).datetimebox("spinner").timespinner("setValue","00:00:00");
}
}); </script>
//引用js文件
<script type="text/javascript" src="./javascript/address.js"></script>
<script type="text/javascript" src="./javascript/logistics/sectionManage.js"></script>
js代码:
var sectionManageObj = {
ProvinceList: [],
initForm: function () {
site_address.forEach(function (aa, bb) {
if (aa.TopID == ) {
sectionManageObj.ProvinceList.push(aa)
}
});
sectionManageObj.bindaddresscombox('', '', '');
$("#City").combobox({ data: [] })
$("#County").combobox({ data: [] })
},
bindaddresscombox: function (province, city, county) {
$("#Province").combobox({
data: sectionManageObj.ProvinceList,
valueField: "ID",
textField: "AddName",
onChange: function (newvalue) {
$("#City").combobox({
data: sectionManageObj.getsiteaddress(newvalue)
})
$("#County").combobox({
data: []
})
}
});
$("#City").combobox({
valueField: "ID",
textField: "AddName",
onChange: function (newvalue) {
$("#County").combobox({
data: sectionManageObj.getsiteaddress(newvalue)
})
}
});
$("#County").combobox({
valueField: "ID",
textField: "AddName"
});
},
getsiteaddress: function (pID) {
var newlist = [];
site_address.forEach(function (aa, bb) {
if (aa.TopID == pID) {
newlist.push(aa)
}
})
return newlist;
}
}
省市区三级联动(附j全国省市区json文件)的更多相关文章
- javascript 省市区三级联动 附: json数据
html: <label> <span>购买地址</span> <select name="PurchaseProvince" style ...
- 省市区三级联动[JSON+Jquery]
<!DOCTYPE html><head> <title>省市区三级联动[JSON+Jquery]</title> <script src=&qu ...
- jquery省市区三级联动(数据来源国家统计局官网)内附源码下载
很久很久没有写博了. 今天更新了项目的省市区三级联动数据,更新后最新的海南三沙都有,分享给所有需要的小伙伴们... JQUERY + JSON,无数据库,纯JS代码,无加密,无压缩,可直接使用在任何项 ...
- javaweb--json--ajax--mysql实现省市区三级联动(附三级联动数据库)
在web中,实现三级联动很常见,尤其是利用jquery+json.但是从根本上来说jquery并不是最能让人容易理解的,接下来从最基本的javascript开始,实现由javascript+json+ ...
- JQuery+Json 省市区三级联动
一.画面以及JS <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content=&qu ...
- 【转】纯JS省市区三级联动(行政区划代码更新至2015-9-30)
本文代码实现的功能是省市区三级联动下拉列表,纯Javascript,网上已有很多这方面的代码.但是作为一个新手,这是我的第一篇CSDN博客,发此文的目的主要是学习交流,希望看到的朋友发现有什么不对的地 ...
- jquery省市区三级联动
jquery省市区三级联动(数据来源国家统计局官网)内附源码下载 很久很久没有写博了. 今天更新了项目的省市区三级联动数据,更新后最新的海南三沙都有,分享给所有需要的小伙伴们... JQUERY + ...
- JS实现年月日三级联动+省市区三级联动+国家省市三级联动
开篇随笔:最近项目需要用到关于年月日三级联动以及省市区三级联动下拉选择的功能,于是乎网上搜了一些做法,觉得有一些只是给出了小的案例或者只有单纯的js还不完整,却很难找到详细的具体数据(baidu搜索都 ...
- 用jsp实现省市区三级联动下拉
jsp+jquery实现省市区三级联动下拉 不少系统都需要实现省市区三级联动下拉,像人口信息管理.电子商务网站.会员管理等,都需要填写地址相关信息.而用ajax实现的无刷新省市区三级联动下拉则可以改善 ...
随机推荐
- 数据量你造吗-JAVA分页
原创地址: http://www.cnblogs.com/Alandre/ (泥沙砖瓦浆木匠),需要转载的,保留下! Thanks 学习的心态第一,解行要相应.其实<弟子规>在“余力 ...
- Chapter 4 Invitations——8
"So," Mike said, looking at the floor, "Jessica asked me to the spring dance." “ ...
- Python下用Scrapy和MongoDB构建爬虫系统(1)
本文由 伯乐在线 - 木羊 翻译,xianhu 校稿.未经许可,禁止转载!英文出处:realpython.com.欢迎加入翻译小组. 这篇文章将根据真实的兼职需求编写一个爬虫,用户想要一个Python ...
- CSS定位概述
CSS中有三种基本的定位机制:普通流,浮动和绝对定位. 1.相对定位:relative 如果对一个元素进行相对定位,它将出现在它所在的位置上,然后可以通过设置垂直或者水平位置,让这个元素“相对于” ...
- js_jquery_创建cookie有效期问题_时区问题
用jquery设置Cookie过期的两种方式: $.cookie('名', '值', { expires: 过期时间(DateTime), path: "/", domain: w ...
- 第一册:lesson ninety-nine。
原文: Ow ! Ow! What's the matter,Andy? l slipped and fell downstairs. Have you hurt yourself? Yes,I ha ...
- 利用http协议对搜索引擎劫持
主要是利用了http协议的refereer头 另外一个头user-agnet 主要是用来做流量劫持 referer 头告诉服务器用户从哪里找来的 当用户通过搜索引擎打开网站时会出现源网页 refere ...
- mysql 创建函数This function has none of DETERMINISTIC, NO SQL, or READS
今天在mysql 5.6上创建函数的时候 发现报错: ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or R ...
- MyEclipse中jsp编码设置
window->preference->Myeclipse->files and editors->jsp,设置编码为utf-8 2.window->preference ...
- SpringBoot的打包失败
打包是根据pom.xml文件来打的包. 如果使用Maven的默认打包,只会将src/main下的java和resources里面的内容打进Jar包中. 通过maven-assembly-plugin这 ...