When you are creating a form, you often want the person
filling out the form to provide an address. Given the
international nature of the internet, one thing that
you need to capture as part of any address is the
Country. The countries in the world are relatively
static (barring wars and successions) so a drop down
list where the person can select their country rather
than typing it is one option to consider. Unfortunately
there are quite a lot of countries in the world and
finding a relatively complete list may take some time
let alone the time required to convert that list into a
drop down selection box.
Never fear because I am about to save you the trouble
of doing any of that. The following generates the HTML
for a dropdown list that allows one of 235 different
countries to be selected which is as close as I can get
to including all of the countries of the world. All you
need to do is to name the drop down list and select
which country you want as the default. (If I
haven't offered your preferred country as the
default you can change the code to get the default you
want by selecting Australia and then
transferring the '
selected="selected"' code to the option
that you want as the default).
If you are wondering what the dropdown looks like once
inserted into your page, here is a form containing the
code with Australia selected as the default.