Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Cindhu on Jul 31, 2009 14:07
open dhtmlx forum
Populating one combo box based on the values in another combo box

I have two combo boxes. One combo box will have county names. Another combobox will have city names. I have to populate city names based on the county name selected. How to do this?

Answer posted by Alex (support) on Aug 03, 2009 02:07

Hello, 

combo has onChange event - it occurs when option is selected. So, you can set onChange event handler for country combo and reload the cities combo here:

combo1.attachEvent("onChange",function(){

combo2.clearAll(true)

combo2.loadXML(....+"?val="+combo1.getActualValue())

})