我需要三个连续的下拉框菜单 [英] I need three sequential drop box menus

查看:79
本文介绍了我需要三个连续的下拉框菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

预期结果:


点击选择国家/地区,打开一个下拉菜单,其中列出了所有世界上的国家/地区。


从该列表中选择一个国家/地区,然后打开另一个下拉菜单,列出该国家/地区的所有省/州。


从该列表中选择一个省/州,并有另一个下拉菜单然后打开,列出该省/州的城市。


选择城市将打开一个新网页,其中包含来自该城市的信息。


目前,我正在温哥华的计算机上使用Access填充三张桌子。他们是国家 - 省/州 - 城市。 国家/地区表包含国家/地区名称和2个字母的FIPS代码。省/州表包含省/州名称和3个字母的区域代码以及2个字母的FIPS代码。两种情况下的代码都是唯一的。一旦三个表格完全填充,我将运行一个程序,将它们转换为MySQL,同时将它们传输到我在加利福尼亚州的服务器。


我非常熟悉Access,并且我没有遇到问题,但我对MySQL并不熟悉。任何人都可以指出我的编码将完成我需要的那些下拉菜单?我还需要一个简单的英文描述,说明如何将菜单指向正确的表格。我也非常熟悉HTML编码,但不会太过异国情调。


如果此类问题之前已在此处发布,我提前道歉,但我找不到任何内容我的搜索。

解决方案

听起来很简单。


看看这里查看用javascript编写的脚本,它完成了你所追求的部分内容。


现在您需要做的是代替该示例中的硬编码列表,您可以检查数据库中的列表。我建议您使用 MySQL教程来熟悉如何检索数据。


感谢您指点我的脚本。正如您所猜测的那样,我最大的问题是找出如何使用这样的脚本,调出Access数据库中的数据(3个单独的表)。我会根据MySQL教程提出你的建议,但首先我需要让它调出Access表。但是,你在这里给了我一些很好的指导,我感谢你。


没问题,让我们知道你怎么走,如果你自己的脚本有问题,请回来

Desired result:

Click Select Country and have a drop menu open that lists all of the world''s countries.

Select a Country from that list and have another drop menu then open that lists all of the provinces/states in that country.

Select a Province/State from that list and have another drop menu then open that lists the cities in that Province/State.

Selecting a City will open a new web page with information from that City.

At the moment I am populating three tables using Access on my computer here in Vancouver. They are Countries - Province/State - Cities. The Countries table contains the country name and the 2-letter FIPS code. The Province/State table contains the province/state name and the 3-letter Region Code as well as the 2-letter FIPS code. The codes in both cases are unique. Once the three tables have been fully populated, I will be running a program that will convert them to MySQL while transferring them to my server in California.

I am fairly conversant with Access, and am not having a problem there, but I''m not at all familiar with MySQL. Can anyone point me to coding that will accomplish what I need with those drop menus? I also need a plain English description of how to point the menus to the correct tables. I am also quite conversant with HTML coding, subject to it not getting too exotic.

My apologies in advance if this type of problem has been previously posted here, but I could find nothing in my search.

解决方案

Sounds simple enough.

Have a look here to see a script written in javascript which does part of what you''re after.

Now what you have to do is instead of the hard coded list in that example, you have it check your database for the list. I suggest doing a MySQL tutorial to get familiar with how to retrieve data.


Thank you for pointing me to that script. As you have guessed, my biggest problem is figuring out how to have a script such as that, bring up the data in my Access database (3 separate tables). I''ll take your suggestion vis-a-vis the MySQL tutorial, but first I need to have it bring up the Access tables. However, you have given me some good guidance here, and I thank you for that.


No problem, let us know how you go, and come back if you have problems with your own script.


这篇关于我需要三个连续的下拉框菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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