I used JS to create a three-level linkage between province, city, and county. The value that can be stored in the database is incorrect, and there are code and online issues, after I select the address, I will submit it to the database. But now, how to modify the value submitted to the database is the encoding above, not the subsequent text. How can I modify it to correctly submit the text behind it? I hope I know that the three-level linkage effect of using JS for a province, city, and county can be stored in the database. the old value is incorrect, there are code, online, and so on.
The problem is that after I select the address, I will submit it to the database. but how can I modify the value submitted to the database is the encoding above, it is not followed by text. How can I modify the text to be correctly submitted? hope that the person who knows can solve problems for the younger brother .........
The code in the selection box is as follows:
Higher-level origin code:
Save:
SelectCity:
SelectCounty (district ):
Name = "jco" id = "jco">
Select
New PCAS
("Jpr", "jci", "jco", ""); script
The following is the JS code:
Var city_data = "";
City_data = "010000 | please select, 110000 | Beijing, 110100 | Municipal District, 110101 | Dongcheng district, 110102 | Xicheng district, 110103 | Chongwen district, 110104 | Xuanwu District, 110105 | Chaoyang district, 110106 | Fengtai district, 110107 | Shijingshan District, 110108 | Haidian district, 110109 | Mentougou district, 110111 | Fangshan district, 110112 | Tongzhou district, 110113 | Shunyi district, 110114 | Changping district, 110115 | Daxing district, 110116 | Huairou district, 110117 | Pinggu district, 110200 | county, 110228 | Miyun county, 110229 | Yanqing county, 120000 | Tianjin, 120100 | Municipal District, 120101 | Heping District, 120102 | Hedong district, 120103 | Hexi district, 120104 | Nankai district, 120105 | Hebei district, 120106 | Hongqiao district, 120107 | Tanggu district, 120108 | Hangu District, 120109 | Dagang District, 120110 | Dongli District, 120111 | Xiqing district, 120112 | Jinnan District, 120113 | Beichen district, 120114 | Wuqing district, 120115 | Baodi District, 120200 | county, 120221 | Ninghe county, 120223 | Jinghai County, 120225 | Jixian county, 130000 | Hebei province, 130100 | Shijiazhuang city, 130101 | Municipal District, 130102 | Chang 'an district, 130103 | Qiaodong District, 130104 | Qiaoxi district, 130105 | Xinhua District, 130107 | Jinjing mining area, 130108 | Yuhua district, 130121 | Jinjing county, 130123 | Zhengding county, 130124 | Luancheng County, 130125 | Xingtang county, 130126 | Lingshou County, 130127 | Gaoyi county, 130128 | Shenzhe county, 130129 | Zanhuang county, 130130 | Wuji county, 130131 | Pingshan county, 130132 | Yuanshi county, 130133 | Zhao county, 130181 | Xinji city, 130182 | Jinzhou city, 130183 |, 130184 | Xinle city, 130185 | Luquan city, 130200 | Tangshan city, 130201 | Municipal District, 130202 | Lunan District, 130203 | Lubei district, 130204 | Guye District, 130205 | Kaiping District, 130207 | Fengnan District, 130208 | Fengrun district, 130223 | Luxian county, 130224 | Luannan county, 130225 | Leting county, 130227 | Qianxi county, 130229 | Yutian County, 130230 | Tanghai county, 130281 | Zunhua city, 130283 | Qian 'an city, 130300 | Qinhuangdao city, 130301 | Municipal District, 130302 | Haigang District, 130303 | Shanhaiguan District, 130304 | Beidaihe district, 130321 | Qinglong Manchu autonomous county, 130322 | Changli county, 130323 | funning county, 130324 | Lulong county, 130400 | Handan city, 130401 | Municipal District, 130402 | Hanshan district, 130403 | Congtai District, 130404 | Fuxing District ................ and so on. The Center omitting PCAN = city_data.split (",");
Function PCAS (){
This. SelP = document. getElementsByName (arguments [0]) [0];
This. SelC = document. getElementsByName (arguments [1]) [0];
This. SelA = document. getElementsByName (arguments [2]) [0];
This. DefP = this. SelA? Arguments [3]: arguments [2];
This. DefC = this. SelA? Arguments [4]: arguments [3];
This. DefA = this. SelA? Arguments [5]: arguments [4];
This. SelP. PCA = this;
This. SelC. PCA = this;
This. SelP. onchange = function () {PCAS. SetC (this. PCA )};
If (this. SelA) this. SelC. onchange = function () {PCAS. SetA (this. PCA )};
PCAS. SetP (this)