# Trouble with comboBox addItem

**URL:** <https://forum.kirupa.com/t/trouble-with-combobox-additem/131623>\
**Category:** Uncategorized\
**Created:** [December 17, 2004, 5:38pm UTC](https://forum.kirupa.com/t/trouble-with-combobox-additem/131623 "2004-12-17T17:38:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sticmann](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@sticmann](https://forum.kirupa.com/u/sticmann)\
**Post date:** [December 17, 2004, 5:38pm UTC](https://forum.kirupa.com/t/trouble-with-combobox-additem/131623/1 "2004-12-17T17:38:55Z")

</div>

I have a comboBox that I want to populate with data from an XML file. It won’t cooperate.  
this works:

```auto
sFoC.shippingMethod_cb.addItem("hello");

```

but this doesn’t:

```auto
populatePulldown = function (elements) {
     trace(elements[0].attributes.label);//returns "Fast"
     trace(elements[0].attributes.cost);//returns "15.00"
     for (i=0; i<elements.length; i++) {
         sFoC.shippingMethod_cb.addItem(elements*.attributes.label, elements*.attributes.cost);
     }
 }
 

```

It won’t add anything to the cb. I don’t understand why. Both these code snippets were in the same place.  
Any ideas??  
-Joshua
