作者yksg (YKSG)
看板Web_Design
标题Re: [问题] 请问有地区列表吗
时间Mon Mar 10 11:21:42 2008
※ 引述《dspswen (阿天)》之铭言:
: 做表单想到,譬如台北市有北投区 中山区 士林区 ...
: 这些地区的列表有吗(还有所有县市的)
: 还是要自己去看别人的网站 copy ??
我这边有一个写好的java script = = 就拿去用吧~
http://www.badongo.com/file/8209907
使用方法......
1. 先 include file
我的写法: <!--#include file="zipcode.inc" -->
(我只会asp~其他语言我不知道怎麽用)
2. 表单的名称-共三个:PostCode(邮递区号),City1(城市),County1(地区)
我的写法:
<input name="PostCode" type="text" readonly size="5" id="Text3">
<select name="City1" onChange="changeZone(mainForm.City1, mainForm.County1,
mainForm.PostCode, mainForm.Address1, mainForm.Cityindex, mainForm.City,
mainForm.County);" id="Select1">
</select>
<select name="County1" onChange="showZipCode(mainForm.City1,
mainForm.County1, mainForm.PostCode, mainForm.Address1, mainForm.Cityindex,
mainForm.City, mainForm.County);" id="Select2">
</select>
3. 由上面程式码看的出来~还有5个值没写出来~分别是:
City、County、Address1、Cityindex、Address
其实是我自己为了方便写入资料库用的 = =||
我的写法:
<input type="hidden" name="City" id="City">
<input type="hidden" name="County" id="County">
<input type="hidden" name="Address1" id="Address1">
<input type="hidden" name="Cityindex" id="Cityindex">
<input name="Address" type="text" size="40" maxlength="80" id="Address">
ps1:mainForm 为表单Form的名称
ps2: changeZone跟showZipCode 就是Java Script里面的 function
ps3: 我连ps2都买不起了~那来的钱买ps3 = =||...
这样就行了!!~完成基本的二阶梯选单 ~^___^~ 希望你用的到 = =||...
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 219.87.129.242
1F:推 dspswen:推推推推 感谢推 03/10 12:59