473,395 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Passing Variables to Drop Down Menu

Hello;

I never coded in javascript but I taught myself perl through books and tutorials and found many similarities.

This helped me modify a free downloadable javascript snippet of code from a website and do the nessessary changes to adapt it to my needs.

http://javascript.internet.com/forms/country-state-drop-down.html

I need a drop down menu for a registration form where people select states from a menu and automatically will load cities from that state in the following drop down menu.

Well.. the script I found does the same thing except instead of selecting a state to find a city it shows how to select a country to find a state.

What I added on my own is placing a country drop down menu above it to have the option of selecting the following:

1) El Salvador (where I live)
2) USA
3) Any other country

The default value is to load El Salvador with its states and cities.

When one selects OTHER COUNTRIES, I made vanish the drop down menues and present fields for people to write their own details.

Same happens when they select USA, Except is adds a Zip Code field that doenst show for OTHER COUNTRIES.

All of that looks and works wondeful except when from the fields display for OTHER COUNTRIES or USA people go back to El Salvador.

I made the fields vanish OK but when trying to display the States and Cities again it doenst find the DEFAULT STATE to display. (I thought line 311 would take care of it but it didnt).

Plaese download my work of art and change the extention from .txt to .html to see how it works and see the sourse for the complete script.

If you know what Im lacking please let me know..

Best regards
Attached Files
File Type: txt Country_Dropt_Down.txt (15.1 KB, 307 views)
Jul 4 '11 #1
0 1340

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: julian | last post by:
hi I was wondering if anyone can help me out on this.... I have dynamcally populated a drop down menu with data from an access database using ASP. The values seem fine, however when i pass...
10
by: Haines Brown | last post by:
I've implemented the horizontal drop down menu discussed recently in this newsgroup, and it works nicely under Galeon and Mozilla, but not IE 5.0. Here are the problems: Under IE 5.0, the...
1
by: M.L. | last post by:
Hi NG, I hope someone in here is able to help me in this matter. The problem: I have created a Javascript drop-down menu which expands when moving the mouse into a tablecell (calls my Expand()...
2
by: hemanth.singamsetty | last post by:
Hello there, I've a drop down menu (created using CSS & Javascript -- see code below). My problem is, whenever I click a link on the menu the new page replaces the current page (and the menu...
3
by: scaredemz | last post by:
hi, so i'm creating a dynamic drop-down menu. the menu and the text show up fine in IE but only the drop-down shows in Firefox without the menu text. Below is the fxn code. help pls. function...
8
by: barbarowa | last post by:
I've coded a script to populate a drop down menu from a database but I can't seem to get the PHP script to pass the selected item. The database only has two fields, ID and ITEM. I want the user...
1
by: phpnewb | last post by:
Hi, I know i'm doing it wrong, but I'm using a while loop right now to create several instances of a drop down menu. It gives me undesirable results. Can you tell me the right way to do it. Below are...
3
by: rsteph | last post by:
I have a javascript drop down menu that I borrowed from a website. It utilizes a little .css to help with formatting. The menu works great, and on all 3 of the browsers I'm concerned about; but I am...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
11
SHOverine
by: SHOverine | last post by:
I have an issue with a drop down menu that I am hoping you all can help me with. The issue is when I press "Submit", my code prints back values from a form I developed (eventually I will write them...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.