easyui省市二級聯動

2021-08-17 02:38:58 字數 1014 閱讀 5646

easyui省市二級聯動

1、[html]

所屬區域:

2、[js]

3、[php]

/**

* @todo 得到省市資訊,

* 根據引數pid是否存在判斷是省還是市

*/public function getprovincecityaction()else

}else

$arealist = $marea->getlist( $where, 'id,name');

die(json_encode($arealist));

}

4、[省市資料表結構]

create table `area` (

`id` smallint(11) unsigned not null comment 'id',

`pid` smallint(3) unsigned not null comment '父id',

`name` varchar(20) not null comment '名稱',

`type` tinyint(1) not null comment '型別',

`tel_code` char(5) not null default '' comment '區號',

`district` tinyint(1) unsigned not null default '0' comment '大區',

primary key (`id`),

key `pid` (`pid`)

) engine=myisam default charset=utf8 comment='區域表';

5、[返回資料示例]

[

,,,,

,,,,

]

js 省市二級聯動

bootstrap jquery 省市二級聯動 html panel panel default panel body h2 id selectprovince province1 遼寧省 option province2 selected 吉林省 option province3 黑龍江省 opt...

中國省市 Json 二級聯動

json資料 var cities cshtml select style width auto select select name city style width auto select jquery 根據城市獲取省份 function getstate city 設定省份和城市下拉框的值 f...

二級省市mysql 省市二級聯動小案例講解

在網頁開發過程中,選擇省市的時候,省市之間有關聯,這是乙個小小的二級聯動案例 運用到html css php js以及 ajax的非同步請求 首先建立city.php和province.php檔案和connet.html,將二級聯動的大概結構寫出來,html 如下 省份 請選擇 城市 請選擇 js ...