Today is . Page created 09/20/06

Country Country/State Drop Down Form Choices

A simple international country and state drop down list that automatically repopulates the state section based on the country selected without page refreshes. Select a country and the country's states or provinces are listed on the right. If the country doesn't have any states or provines configured, a text box is displayed.

We have tested the form in IE6.0, Firefox1.5.0.6, Opera9.01, Netscape8.1 and AOL Explorer1.2. It worked well in all platforms with no variations observed.

For Your Information For your Information:     Before we begin, we feel obligated to advise you that the above form is for all intensive purposes a "Stand Alone" script. In other words, it really does not do much of anything other than what you see. In order to make it function as designed, you need to incorporate it into a valid working form. If you do not have a good Solid Knowledge of HTML coding, javascripts, forms and reconfigurations, please "Do Not Attempt" this until you are Proficient in the aforementioned areas.

Depending on your knowledge of HTML and javascripts, this is an easy two (2) part copy and paste code that goes in both the <HEAD> and <BODY> sections of your document. It also makes use of an external .js script you need to save and upload into your directory then add a snipplet of code into the <HEAD> section to call the external.js file.

Warning Logo     Note Of Importance:     If you are not sure of howto make the external .js file and make use of it within your document, grab the below link and it is fully explained.
.js File Howto ]

For Your Information For your Information:     If you are not comfortable or prefer not to use the external.js file, you can use the traditional cut/copy and paste instead of the external .js file. If you need a little refresher on what is required to achieve this, grab the below link and it is fully explained.
Traditional Cut/Copy and Paste ]

* This script unlike most does not name the external.js file. It puts it very well by telling you to:

<!-- Paste this code into the HEAD section of your HTML document
      Change the file name and path to match the one you created -->

<script type="text/javascript" src="yourFileName.js"></script>

In other words, they are telling you to name your external file whatever you want, upload that into your directory and to just reflect that name in the snipplet of code that you would paste into the <HEAD> section to call the file. We named ours countryDropdown.js.

Depending on which of the above methods you have selected (external.js file or Traditional Copy/Cut & Paste), you will add either the snipplet of code (after you have uploaded the external.js file) into the <HEAD> section or the completed section of code that you added the opening and closing script tags.

Snipplet Of Code

<script type="text/javascript" src="countryDropdown.js">
</script>
Traditional Copy/Cut and Paste

<SCRIPT LANGUAGE="JavaScript">

<HEAD> Section of code goes here

//  End -->
</script>

Arrow External .js file



Arrow Traditional Copy/Cut & Paste Code with opening & closing tags that you had to add into the <HEAD> section of code that was originally earmarked to be an external .js file.

If you would like to see an example of this effect using the "Traditional Cut/Copy & Paste" method, grab the below link and you are there. Examine our "Source" code (on the page you will be opening) to see how we had to reconfigure it to make it work. We have it very well documented for your convenience.
Traditional Cut/Copy & Paste Method ]

Once you have completed the above sections, the only thing left is to incorporate the <BODY> section into a functioning form.

On A Final Note     We do have another form that is similar to this if you would like to see and possible use.
Similar Country Drop Down Form ]

We hope our tutorial was easy to follow and we covered everything in detail. If you would like to add this effect into your pages, grab the respective below link and you are there. If you have any problems with this or anything else, feel free to consult our FAQ ] and if you can't find the answer there, contact us ].
Get Code Here ]   [ Rate This Page ]