I wrote a nice little script that handles this.
Below is the code...
-
Function CreateCountries
-
Set oFileStream = Server.CreateObject("Scripting.FileSystemObject")
-
Set oCountries = oFileStream.OpenTextFile(Server.MapPath("/platform/Countries.txt"), 1)
-
aCountries = Split( oCountries.ReadAll, vbCRLF )
-
oCountries.Close
-
Set oCountryOptions = oFileStream.OpenTextFile(Server.MapPath("/platform/CountryOptions.txt"), 1)
-
aCountryOptions = Split( oCountryOptions.ReadAll, vbCRLF )
-
sTemp = sTemp & "<select name=" & Chr( 34 ) & "sCountry" & Chr( 34 ) & " id=" & Chr( 34 ) & "sCountry" & Chr( 34 ) & " style=" & Chr( 34 ) & "width:270;" & Chr( 34 ) & ">"
-
sTemp = sTemp & "<option value=" & Chr( 34 ) & Chr( 34 ) & "></option>"
-
For i = 0 to Ubound(aCountries)
-
sTemp = sTemp & "<option value=" & Chr( 34 ) & aCountryOptions(i) & Chr( 34 ) & ">" & aCountries(i) & "</option>"
-
Next
-
Set oCountries = Nothing
-
Set oCountryOptions = Nothing
-
Set oFileStream = Nothing
-
CreateCountries = sTemp
-
End Function
-
Now, of course, You'll have to have a couple of .txt documents located on the server. One to define the option values, and another to define the textual output of each option.
I have these files if you'd like, but i won't put them here.. they're about 300 lines each.
Email me and i'll give them to you.
To invoke this, include it in some way, shape, or form on your page - and simply...
Call CreateCountries
I also created one for all the Canadian provinces and US states.