邮政编码和城市 [英] zip code and city

查看:80
本文介绍了邮政编码和城市的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,用户可以输入邮政编码(文本编辑),我想根据输入的邮政编码填写

a组合框与现有城市。


让我们举个例子。


我的文字编辑如下:

< input name =" ZIP"类型= QUOT;文本" ID = QUOT; ZIP" onKeyUp =" fillcitycombo();">

< select name =" City" id =" City">< / select>


输入邮政编码时,我想填写fillcitycombo()函数

组合框与相匹配的城市。

例如我已经


IDCity ZIP City

1 1950 Sion

2 1950 Pont-de-la-Morge

3 3960 Sierre

4 3960 Corin


所以用户的条目3960应填写与Sierre,ID 3和Corin的组合,ID

4,因为选择3或4将更改城市(共享相同的邮政编码)。


当然ZIP和城市数据将在javascript源代码中,因为客户端

这边无法访问数据库。有关信息,请在客户的数据库中存储

IDCity代码。


感谢您的帮助。


Bob

I''ve a page where users may enter a zip code (text edit) and I want to fill
a combobox with existing cities depending on the zip code entered.

Let give an example.

I''ve my text edit like:
<input name="ZIP" type="text" id="ZIP" onKeyUp="fillcitycombo();">
<select name="City" id="City"></select>

When entering the zip code, I''d like the fillcitycombo() function to fill
the combobox with the matching cities.
For example I''ve

IDCity ZIP City
1 1950 Sion
2 1950 Pont-de-la-Morge
3 3960 Sierre
4 3960 Corin

So user''s entry 3960 should fill the combo with Sierre, ID 3 and Corin, ID
4, as selecting 3 or 4 will change the city (that share the same ZIP code).

Of course the ZIP and city datas will be in the javascript source, as client
side there is no access to the DB. For info, in the client''s DB I store the
IDCity code.

Thanks for help.

Bob

推荐答案

文章< 41 ********************* @ news.sunrise.ch> ;, bedford1

@ YouKnowWhatToDoHerehotmail.com启发我们...
In article <41*********************@news.sunrise.ch>, bedford1
@YouKnowWhatToDoHerehotmail.com enlightened us with...
我有一个用户可以输入邮政编码的页面(文字编辑)我想根据输入的邮政编码填写现有城市的组合框。
I''ve a page where users may enter a zip code (text edit) and I want to fill
a combobox with existing cities depending on the zip code entered.




这有帮助吗?
http://www.ipwebdesign.net/kaelisSpa...icSelects.html


-

-

~kaeli~

男人谁落入一个室内装潢机器完全恢复了


http ://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace



Does this help?

http://www.ipwebdesign.net/kaelisSpa...icSelects.html

--
--
~kaeli~
The man who fell into an upholstery machine is fully
recovered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace





这就是我要找的东西,但我必须生成清单有4430条记录,

所以我不能手动完成。


我现在有一个包含这些数据的Excel文件:

columnA:recordID

columnB:City

columnC:邮政编码


如何使用你的这些字段想法(抱歉,我不是那么舒服

和js)。


干杯


鲍勃


" kaeli" < TI ****** @ NOSPAM.comcast.net>一个écritdansle message de

新闻:MP ************************ @ nntp.lucent.com ...
Hi,

It''s what I''m looking for, but I''ve to generate the list with 4430 records,
so I can''t do it manually.

I''ve now an Excel file with those datas:
columnA : recordID
columnB : City
columnC : Zip code

How to work with such fields with your idea (sorry I''m not so confortable
with js).

Cheers

Bob

"kaeli" <ti******@NOSPAM.comcast.net> a écrit dans le message de
news:MP************************@nntp.lucent.com...
文章< 41 ********************* @ news.sunrise.ch> ;, bedford1
@YouKnowWhatToDoHerehotmail。 com启发我们...
In article <41*********************@news.sunrise.ch>, bedford1
@YouKnowWhatToDoHerehotmail.com enlightened us with...
我有一个页面,用户可以输入邮政编码(文本编辑),我想
填写一个组合框与现有城市,具体取决于邮政编码输入的代码。
I''ve a page where users may enter a zip code (text edit) and I want to fill a combobox with existing cities depending on the zip code entered.



这有帮助吗?

http://www.ipwebdesign.net/kaelisSpa...icSelects.html

-
-
〜凯莉〜
那个落入室内装潢机器的人已经完全康复了。
http://www.ipwebdesign.net/wildAtHeart
HTTP://www.ipweb design.net/kaelisSpace



Does this help?

http://www.ipwebdesign.net/kaelisSpa...icSelects.html

--
--
~kaeli~
The man who fell into an upholstery machine is fully
recovered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace



文章< 41 ************* ********@news.sunrise.ch> ;, bedford1

@ YouKnowWhatToDoHerehotmail.com启发我们...
In article <41*********************@news.sunrise.ch>, bedford1
@YouKnowWhatToDoHerehotmail.com enlightened us with...

<这是我正在寻找的,但我必须生成4430条记录的清单,
所以我不能手动完成。

我现在有一个带有这些数据的Excel文件:
columnA:recordID
columnB:City
columnC:邮政编码

如何使用你的这些字段想法(对不起,我不是那么舒服
和js)。
Hi,

It''s what I''m looking for, but I''ve to generate the list with 4430 records,
so I can''t do it manually.

I''ve now an Excel file with those datas:
columnA : recordID
columnB : City
columnC : Zip code

How to work with such fields with your idea (sorry I''m not so confortable
with js).




你不可能,更有可能。


答案很大程度上取决于环境。


如果这是针对Intranet / IE-only env,您可以使用ActiveX来读取文件

和东西。


如果不是,你需要将文件保存为服务器上的文本并使用一些

方法retrie将值转换为JS。同样,取决于env,但是

你需要一个服务器端脚本来获取值并在生成之前写入

页面或一个人之后,类似于:
http:// www .ipwebdesign.net / kaelisSpa ... alidation.html

无论哪种方式,都涉及到服务器端脚本语言。


基本上,标准的互联网跨浏览器javascript无法自动读取服务器上的文件。


如果这只是一次性生成硬件的事情-coded javascript基于

你HD上的Excel文件,你可以为

做一个快速的小Excel宏。但是我假设列表发生了变化而且JS是动态的。


如果这只适用于你的机器,你可以使用HTA来阅读

Excel。


看,这完全取决于你在做什么,确切地说。


- < br $> b $ b -

~kaeli~

你不能拥有一切。你会把它放在哪里?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace



You don''t, more than likely.

The answer is highly dependent on environment.

If this is for an intranet/IE-only env, you can use ActiveX to read the file
and stuff.

If it isn''t, you need to save the file as text on the server and use some
method of retrieving the values into the JS. Again, depends on env, but
you''ll need a server-side script to either get the values and write into the
page before it''s generated or one to do it after, similar to:
http://www.ipwebdesign.net/kaelisSpa...alidation.html
Either way, there''s a server-side scripting language involved.

Basically, standard internet cross-browser javascript cannot read files on
the server all by itself.

If this is a one-time only thing to generate hard-coded javascript based on
the Excel file on your HD, you could make a quick little Excel macro for
that. But I''m assuming the list changes and the JS is dynamic.

If this is to work only for you on your machine, you can use an HTA to read
the Excel.

See, it just all depends on what you''re doing, exactly.

--
--
~kaeli~
You can''t have everything. Where would you put it?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


这篇关于邮政编码和城市的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆