I have a mySQL table with a list of countries, and a second table with a list with cities.
To display the countries, I call the following code:
And to call the cities, I call the following function:
I now wish to populate 2 select boxes (javascript) so that when a specific country displays in the 1st box, the cities for taht country will display in the second.
Any help will be appreciated.
To display the countries, I call the following code:
Code:
<%
Function list_CountryOptions(ByVal intSelectedCountry)
Dim tempRS
intSelectedCountry = Trim(intSelectedCountry)
If Not util_IsValidID(intSelectedCountry) Then
intSelectedCountry = util_GetCountry()
End If
''refresh application value?
If Application("Countries_" & util_GetLanguage()) = "" Or Request.QueryString("init") <> "" Then
Call dalList_GetCountryList( _
list_GetLanguageColumnName(), _
list_GetLanguageColumnName(), _
tempRS)
list_CountryOptions = list_GetListOptions(tempRS)
Set tempRS = Nothing
Application.Lock
Application("Countries_" & util_GetLanguage()) = list_CountryOptions
Application.UnLock
Else
''get value
list_CountryOptions = Application("Countries_" & util_GetLanguage())
End If
''mark selected ID option
list_CountryOptions = Replace(list_CountryOptions, _
"""" & intSelectedCountry & """", _
"""" & intSelectedCountry & """ SELECTED")
End Function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''%>
Code:
Function list_CityOptions(ByVal SelectedID)
list_CityOptions = list_CityOptionsForCountry(SelectedID, _
util_GetCountry(), util_GetLanguage())
End Function
Any help will be appreciated.