1. the onChange event on my combos doesn’t seem to trigger until I click on another element, is there some way I can make it trigger as soon as I move the mouse out of the combo input area similar to the OnBlur event?
2. I have multiple combos on a page which have the same option list.
I have successfully used dhtmlAjax to add any new options entered to my db.
Now I am trying to add the new option to the combo updated and the other duplicate combos.
I am building the array to rebuild the options in the php page I use to update the db, and have checked that loader.xmlDoc.responseText returns the following:
I thought I could plug this into addOption and rebuild the option list as in the code below, but it doesn’t work. THe option list gets cleared, but the new options don’t appear. Am I on the wrong track?
Category*
Baking
Beverage
Breakfast
Christmas
Cleaning Product
Confectionery
Dessert
Entree
Main Meal
Marinade
Microwave
Side Dish
Snack
Test
3. Can I omit the value field when using addOption, as I don’t need it?
>> the onChange event on my combos doesn’t seem to trigger until I click on another element, is there some way I can make it trigger as soon as I move the mouse out of the combo input area similar to the OnBlur event?
onChange occurs when enter key is pressed or you press somewhere and combo loses focus.
There is onBlur event too.
>> THe option list gets cleared, but the new options don’t appear
addOption method requires array, not string. Combo can be also loaded from xml file or string: loadXML(url), loadXMLString(string)
>> Can I omit the value field when using addOption, as I don’t need it?
However, just to let you know - using the xml string format you provided I ended up with both the value and the text being added to my option list. To correct this I omitted the value parameters like this