PDA

View Full Version : load listbox by xml?



gen329
March 20th, 2004, 05:46 PM
hello there, I know how rude it is to post a question being a new person to the forum and such, but I was wondering, I am trying to load a listbox through xml and my script does not seem to work at adding the items. Could someone please look over the script and tell me what is wrong? Here it is...



Prog_xml.load(Programs.xml)

xml.onLoad = function (success){
for (i=0; i<Prog_xml.childNodes.length; i++){
list.addItem (Prog_xml.childNodes[i].attributes.nodeName , Prog_xml.childNodes[i].attributes.value)
}
}

function Change (c){
textbox.text = c.getSelectedItem().label;
text2.text = c.getselectedItem().data;
}

list.setChangeHandler("Change");



once again I am very sorry to post this as I am so new to the forum.

eyezberg
March 21st, 2004, 02:37 AM
Welcome, no harm in being new, you can still post questions ;)
Try to use the php or as tags around your code, makes it easier to read.
Try to add traces in there to check if your populating with the right childNode (in the for loop), might just be a matter of child child..