XML - Dynamic Combo Boxes
Howdy. Just looking for some advice on a problem, or a better way to do things.
I have 3 combo boxes for a description of a car. So Make, Model, Year. Then, i use the same combo boxes to show the car description according to the VIN number you have entered. Also, the Model combo box needs to be dynamic even more so, by reloading new model data depending on what make of car you choose in the Make Combo box.
I have created a working model, somewhat, but i think its messy. I do not have the code here, but i was looking for the best solution to this problem. So far im using XML, but i might not be using it in the best format.
I use an XML object calling a server script for each combo box, except Year. Thats hard coded. So, I have an XML object for Make, XML object for Model, and a XML Object for VIN. Now, the part that really starts getting sticky is the setChangeHandlers for Make. Because, every time you enter, or renter a VIN number it triggers the Handler on Make and then triggers the handler on Model. Each combo box also needs to show which model and make and year the car is for the VIN. So it needs to sift through the list and setSelectedIndex() to whatever it needs.
I hope this is enough info for some advice. If not, sorry about that.
Thanks everyone,
Plankton
|