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.
15 3641 TheServant 1,168
Recognized Expert Top Contributor
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.
TheServant 1,168
Recognized Expert Top Contributor
No problem, let us know how you go, and come back if you have problems with your own script.
Done, and it works fine. However, I have just been informed that my web site host does not allow JavaScript files, unless I pay extra. I'm now trying to figure out if I can directly convert the entire .js file into either a .html or .php file. Fun, fun, fun...
TheServant 1,168
Recognized Expert Top Contributor
That sucks.
You can run javascript in the body of your HTML. There are several reasons this is not encouraged (caching, separation of structure, etc.), but it looks like your only option.
Basically you just encapsulate what was in the .js file with: - <script type="text/javascript" language="javascript">
-
.js file contents go here
-
</script>
And then put that in your <body> tag in your HTML. Preferably at the botton, directly before </body>.
Let us know if you have any problems with that.
Thanks for the suggestion. I did that, but my selection boxes are now non-operational. All three are very small boxes and not selectable. Just to make sure I did this correctly, I opened the .js file in Notepad, and copied the entire contents. I then plugged in the brief script you suggested, with the .js contents pasted in where you indicated. Is it possible that the 'Form' coding needs adjusting? It is:
<form>
<table border="0">
<tr>
<td>
<select id='countrySele ct' name='country' onchange='javas cript: populateState() ; populateCity(); '></select>
</td>
<td>
<select id='stateSelect ' name='state' onchange='javas cript: populateCity(); '></select>
</td>
<td>
<select id='citySelect' name='city'></select>
<script type="text/javascript">ini tCountry('CA'); </script>
</td>
</tr>
</table>
</form>
And now I'm signing off for the night (I'm Vancouver time). Thanks again for your ongoing help!
TheServant 1,168
Recognized Expert Top Contributor
You don't need to say it's javascript here: - onchange='javascript: populateCity();'
-
Can just be:
-
onchange="populateCity();"
-
Also, in you country dropdown you call populateCity() twice.
I don't think either of those will be the problem, but I will have a closer look a bit later.
All three of the drop down boxes worked fine prior to my plugging the .js file into the html body. They showed all the countries and allowed a selection. The code populated the State drop down box and let the user select a city. Normally when a City is selected, a html page opens. If there is no html page for a selected city, nothing further happens when you click on the City name.
I guess the bottom line here is that the .js script works fine here on my computer, using it as a separate file (not embedded in the home page). I have the same problem here after plugging the .js into the home page, in that the drop down boxes no longer function, and they are truncated in length. So, I think we can agree that the two items you pointed out are not the cause of this. I'm still parsing the coding, line by line where it sits in the body of the home page.
But, thanks for the comments; they are appreciated.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Davmagic .Com |
last post by:
Where can I find a simple, secure Perl script to run my Drop Downs on my
pages? Using Unix...
TIA
Web Design, Magic, Painting, Junking, More
http://www.davmagic.com
Paint A House
http://www.paintahouse.com
NOTE: This emailbox is CLOSED do NOT reply!!!
|
by: delerious |
last post by:
I'm going to build a vertical navigation menu using images in HTML. I want to
have a drop-down menu appear next to an image when I move the mouse over it.
I know that I could just download any one of the many free Javascript menus
available on the web and not have the images in the HTML, but I want the
images to be seen (and able to be clicked on) if Javascript is disabled. None
of the free Javascript menus that I have seen work that way....
|
by: Joey Liang via DotNetMonster.com |
last post by:
Hi all,
I am new in asp.net, i encounter some problems in using drop down
list and datagrid. I have manage to bind the data into datagrid but i
wanted to bind the data into the datagrid accroding to the selected brand
from the drop down list. I do not have any idea how to do it. Does anyone
knows how to bind the data in to datagrid accroding to the drop down list
selected item? if there is a way would u mind paste the code or any...
|
by: Joey Liang via DotNetMonster.com |
last post by:
Hi all,
I have a drop down list which store all the different brands of
product.When i selected the particular brand from the drop down list, it
will display all the products with the selected brand in a datagrid. I have
this error when i select a brand from the drop down list. Blow is my
code,anyone can help me to solve my error,which part of my code went wrong?
Really thanx and very appreciate your help in advanced.. I have been
stucked...
|
by: ashok76 |
last post by:
Hi
I've a DataGridView and where has column 0 is a DataGridViewComboBoxColumn Whenever I selected that cell then the drop down list not appeared on single click event hence I need to click again Two times then the Drop Down List will be Appeared but i want to Get appeared the Drop down list on single click so please help me.
If any one help me it's a great thanx from me to him.
Regards
Ashok76
| |
by: masker |
last post by:
I was on the web trying to find a javascript that would allow me to input a number on my website and have it increase by a given percentage every second.
During my search I found the Earth Population Calculator on the javascripkit.com site. The Calculator functions just as I imagine I want my number generator to function, but I need it to present a different number.
I work for a non profit organization that administers Head Start and...
|
by: trint |
last post by:
I have a datagridview which must have 3 textbox's in a single cell per
row:
textbox1 for Length
textbox2 for Width
textbox3 for Height
Any help is very much appreciated.
Thanks,
Trint
|
by: rodeoval |
last post by:
I need to have three drop down lists, but the dependent should get the values from the database without refreshing the page..If knows,someone pls reply soon
|
by: aboutjav.com |
last post by:
Hi,
I am new at asp.net and want to add a horizontal dropdown menu like
toolstripmenu in windows form. I found a drop down menu written in
javascript (DHTML). How do I add to my asp.net project. I have a
masterpage which contains the navigation panel, header, and the main
content panels. I prefer to add to my header panel, where I originally
drag a header control, which contains a table with just plain links
for HOME, CATEGORIES, etc..
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |