How to set-up a Master - Slaves XML combos.
In a combo i select a value. This value includes many subvalues that i want to choose one of them in a second combo.
Classic example: choosing a city that is a subvalue of a state choice.
I was thinking about making many xml, how many are the states, and one big xml with all states.
But how can load the right xml in second combo when i choose the state?
Another way to do that?
Please a bit of a pratical example.
You can use onChange combo
combo.attachEvent(“onChange”,function(){
combo2.loadXML(combo.getComboText()+".xml");
});
Also, latest version of combo allows automatic grouping.
dhtmlx.com/docs/products/dhtmlxC … 4833065000
Sorry but I don’t understand what are you meaning…
Follow my example please:
First combo:
The second combo need to be a slave of the first, so you suggest this:
combo.attachEvent(“onChange”,function(){
combo2.loadXML(combo.getComboText()+".xml");
});
So how i can do this?
I’m not a very practical boy whit this code… Please help me…
Next, I suppose that I can’t use automatic grouping, because every xml was preuploaded, and not dinamically generated by a server side code.
We have used combo and combo1 as an example.
If the master combo is z1 and the slave one is z2, the code should be as follows:
You can reload z2 with any xml. In our example xml name is the same with option text in the master combo.
Thank you so much support, that code works great and perfectly.
Also good explanation code.