全選と地域連動
222375 ワード
全部選択する
$(function($) {
// /
$("#listForm .checkAll").click(function(){
$("#listForm tbody :checkbox").prop("checked",$(this).prop("checked"));
});
//
$("#listForm tbody :checkbox").click(function(){
$("#listForm .checkAll").prop("checked",$("#listForm tbody :checked").length== $("#listForm tbody :checkbox").length);
});
});
html<form id="listForm" method="post" action="list">
<table class="table table-bordered table-bgColor table-striped table-condensed table-hover">
<thead>
<tr>
<th width="12"><input type="checkbox" class="checkAll"/></th>
<th width="120"> </th>
<th> </th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox"/></td>
<td> 1</td>
<td> 1</td>
</tr>
<tr>
<td><input type="checkbox"/></td>
<td> 2</td>
<td> 2</td>
</tr>
</tbody>
</table>
</form>
地域連動js/** * * @param pid select id * @param cid select id * @param did select id */
var Geo=function(pid,cid,did){
this.p=document.getElementById(pid);
this.c=document.getElementById(cid);
this.d=document.getElementById(did);
this._initData();//
this._fillProvinces();//
this._setListeners();//
};
// select
Geo.prototype._pReset=function(){
this.p.options.length=0;
this.p.options[0]=new Option(' ','');
};
// select
Geo.prototype._cReset=function(){
this.c.options.length=0;
this.c.options[0]=new Option(' ','');
};
// / select
Geo.prototype._dReset=function(){
this.d.options.length=0;
this.d.options[0]=new Option(' / ','');
};
// select
Geo.prototype._fillProvinces=function() {
this._pReset();
var items = this.ps;
for (var i = 0; i < items.length; i++) {
this.p.options[i+1]=new Option(items[i],items[i]);
}
this._cReset();
this._dReset();
return items.length>0;
};
// select
Geo.prototype._fillCities=function(p) {
this._cReset();
var items = this.pc[p];
for (var i = 0; i < items.length; i++) {
this.c.options[i + 1] = new Option(items[i], items[i]);
}
this._dReset();
return items.length>0;
};
// / select
Geo.prototype._fillDistricts=function(p,c) {
this._dReset();
var items = this.cd[p+"_"+c];
for (var i = 0; i < items.length; i++) {
this.d.options[i + 1] = new Option(items[i], items[i]);
}
return items.length>0;
};
//
Geo.prototype._initData=function(){
this.pc={};//{" 1":[" 1"," 2"]," 2":[" 3"," 4"]}
this.cd={};//{" 1":[" 1"," 2"]," 2":[" 3"," 4"]}
this.ps=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "];
this.pc[" "]=[" "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "];
this.pc[" "]=[" "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "];
this.pc[" "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.pc[" "]=[];
this.pc[" "]=[];
this.pc[" "]=[];
// , key
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[];
this.cd[" _ "]=[];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "];
this.cd[" _ "]=[" "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "];
this.cd[" _ "]=[" "," "," "];
this.cd[" _ "]=[" "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "," "," "," "];
this.cd[" _ "]=[" "," "," "," "];
};
// select select
Geo.prototype._setListeners=function(){
var self=this;
this.p.onchange=function(){
if(this.selectedIndex>0){
self._fillCities(this.children[this.selectedIndex].value);
}else{
self._cReset();
self._dReset();
}
};
this.c.onchange=function(){
if(this.selectedIndex>0){
self._fillDistricts(self.p.children[self.p.selectedIndex].value,this.children[this.selectedIndex].value);
}else{
self._dReset();
}
};
};
// option , , .
Geo.prototype._sel=function(ops,val){
if(val){
for (var i = 1; i < ops.length; i++) {
if (val == ops[i].value) {
ops[i].selected = true;
return true;
}
}
}
return false;
};
/** * , , , / . * @param p * @param c . * @param d / . * @returns {*} . , , / true, false */
Geo.prototype.sel=function(p,c,d){
return this._sel(this.p.options,p)&&this._fillCities(p)
&&this._sel(this.c.options,c)&&this._fillDistricts(p,c)
&&this._sel(this.d.options,d);
};
html<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="../static/jquery/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../static/Geo.js" charset="utf-8"></script>
</head>
<body>
<select class="select" name="province" id="province"></select>
<select class="select" name="city" id="city"></select>
<select class="select" name="district" id="district"></select>
<script> $(function($) { var geo=new Geo('province','city','district'); geo.sel(' ',' ',' '); }); </script>
</body>
</html>