citypicker简单使用

先是html代码
需要引入以下四个文件

<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/citypicker/js/city-picker.data.js"></script>
<script type="text/javascript" src="../js/citypicker/js/city-picker.js"></script>
<link rel="stylesheet" href="../js/citypicker/css/city-picker.css" />
<div style="position:relative;" class="pc-kk-form-list">
    <input readonly type="text" data-toggle="city-picker" value="" name="areaMsg" id="areaMsg" type="text" placeholder="&nbsp;&nbsp;省/市/区">
</div>

js代码

$("#areaMsg").citypicker();

后台

    private String areaMsg;
    public void setAreaMsg(String areaMsg) {
        this.areaMsg = areaMsg;
    }
    //区域类,包含省市区属性
    Area Area = new Area();
    //通过"/"分割areaMsg获得省市区
    String[] areaData = areaMsg.split("/");
    area.setProvince(areaData[0]);
    area.setCity(areaData[1]);
    area.setDistrict(areaData[2]);

阅读更多
文章标签: html citypicker
想对作者说点什么? 我来说一句

city-picker城市选择插件

2016年11月29日 147KB 下载

没有更多推荐了,返回首页

关闭
关闭