Today is . Page created 08/12/05, updated 09/20/06

Country Country Chooser Form Choices

T his script is for a form that needs to know the visitor's country. It saves giving a huge list of countries in one box. For the USA, it also asks the state.

We have tested the code in IE6.0, Firefox1.5.0.4, Opera9.0, Netscape8.1 and AOL Explorer1.2. This script worked in IE, Opera9.0 and AOL Explorer1.2. In all other platforms tested, the form would not work. Once you select a Region from the drop down selection, it would not transpose the different regions to the other form field on the right side. It degrades well and you will not get any error messages.

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.

D epending on your knowledge of HTML and javascripts, this is a two part copy and paste code that goes in both the <HEAD> and <BODY> (incorporated into a form) sections of your document. Once this is done, there are no reconfigurations within the script itself.

Warning Logo     Note Of Importance:     In reference to the site where you will be getting the code. The way it is set up is a little confusing. The code is set up as a complete HTML document but......

You need to study the copy and paste code and you will notice the part of the code that should go in the <HEAD> section, is defined to go in the <BODY> section. See below:

<html>
<head>
<title>Country Chooser</title>
</head>

<body> ~ Starting Just Below Goes In The <HEAD> Section!!! ~ Not The <BODY> Section!

<!-- Original: Mattias Sjogren (masj4037@student.uu.se) -->
<!-- This script and many more are available online from -->
<!-- The JavaScript Source!! http://javascriptsource.com -->
<script language="JavaScript">
<!--
var africaArray = new Array("('Select country','',true,true)",
"('Ethiopia')",
"('Somalia')",
"('South Africa')",

I n the above partial section of code, the way it appears, it shows going in the <BODY> section. "Wrong!!!". This section goes in the <HEAD> section. The above is only part of the <HEAD> section. Study the code and you will see this section goes all the way to the closing </script> tag.

      }
}
if(inForm.country.options[0].text == 'Select country') {
inForm.country.options[0]= null;
      }
}
//-->
</script>

T he only part of the code that goes in the <BODY> section is the below code from the opening <form> tag to the closing </form> tag. See below:

<form name="globe">
<select name="region" onChange="populateCountry(document.globe,document.globe.region.options[document.globe.region.selectedIndex].value)">
<option selected value=''>Select Region</option>
<option value='asia'>Asia</option>
<option value='africa'>Africa</option>
<option value='australia'>Australia</option>
<option value='europe'>Europe</option>
<option value='middleeast'>Middle East</option>
<option value='lamerica'>Latin America</option>
<option value='namerica'>North America</option>
<option value='samerica'>South America</option>
</select>
<select name="country" onChange="populateUSstate(document.globe,document.globe.country.options[document.globe.country.selectedIndex].text)">
<option value=''><--------------------</option>
</select>
</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 ]

W e 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 ]  

Talk Live To A Support Technician

Search Our Site By Individual letter

A ]  [ B ]  [ C ]  [ D ]  [ E ]  [ F ]  [ G ]  [ H ]  [ I ]  [ J-K ]  [ L ] 
M ]  [ N-O ]  [ P-Q ]  [ R ]  [ S ]  [ T ]  [ U-V ]  [ W ]  [ X-Y-Z ] 

Little Tips Directory

Page 1  ] [ Page 2 ] [ Page 3 ] [ Page 4 ] [ Page 5  ] [ Page 6  ] [ Page 7  ]

Index Page 1 ] [ Index Page 2 ] [ Index Page 3 ] [ Index Page 4 ] [ Index Page 5 ]
Index Page 6 ] [ Index Page 7 ] [ Index Page 8 ] [ Index Page 9 ] [ Index Page 10 ]
Index Page 11 ] [ Index Page 12 ] [ Index Page 13 ]

News Letter Archives ] [ Navigation Page ] [ Archives Of Published Material ]
Link To Us ] [ Alphabet Index ] [ Feedback ] [ On Line Support ] [ FAQ ]
Webmaster Utilities ] [ Casino ] [ Banner Exchange ] [  Advanced Site Search ]

If you are part of the ever growing number of webmasters who enjoy sharing your knowledge with others on web design, join The Consigliere Ltd. web ring to broaden your scope of exposure.
Join Today

This Site Was Built And Is Maintained Exclusively by
The Webmaster @ Consigliere Ltd.

Copyright © Consigliere Ltd., All Rights Reserved. 2001-