tomouse
Technical User
- Aug 30, 2010
- 50
I have 3 dropdownlists. They list Country, City and Hotel, populated from a SQL database. The user selects a country and this filters the cities, they choose a city and it filters the hotels. Up until now I've been using server side code (VB.NET) to take the country code from the country dropdown, plug that into a lookup for the cities and then repopulate the city dropdown accordingly. Likewise, when the user selects a city, the server takes the city code and uses this to filter the Hotels (this is called cascading dropdowns right?).
However, all these trips to the server are making things very slow. When the user selects a country, there is a delay of around 3 seconds before the cities are updated. Is it possible to do this on the clientside using Javascript to speed things up? Maybe all the data for countries, cities and hotels is first sent to the client, then the filtering can be done client side? If anyone could point me in the right direction this would be great. I have spent quite a while searching for examples, but none of them seem to do what I want. The end point is that I need to save the code of the hotel that the user selects...
However, all these trips to the server are making things very slow. When the user selects a country, there is a delay of around 3 seconds before the cities are updated. Is it possible to do this on the clientside using Javascript to speed things up? Maybe all the data for countries, cities and hotels is first sent to the client, then the filtering can be done client side? If anyone could point me in the right direction this would be great. I have spent quite a while searching for examples, but none of them seem to do what I want. The end point is that I need to save the code of the hotel that the user selects...