# Dynamically populating a listbox and more!

**URL:** <https://forum.kirupa.com/t/dynamically-populating-a-listbox-and-more/58058>\
**Category:** Uncategorized\
**Created:** [July 19, 2004, 1:35pm UTC](https://forum.kirupa.com/t/dynamically-populating-a-listbox-and-more/58058 "2004-07-19T13:35:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [July 19, 2004, 1:35pm UTC](https://forum.kirupa.com/t/dynamically-populating-a-listbox-and-more/58058/1 "2004-07-19T13:35:35Z")

</div>

hi all, I need some help figuring out how to populate a listbox with variables. I need to bring in the variables (probably in an array) from an .asp page. Then I need to assign each array element a variable name and get the variables to appear as selectable elements of the listbox component… I’ve been unable to find good resources on this anywhere! any experts out there have some good advice?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2004, 2:25pm UTC](https://forum.kirupa.com/t/dynamically-populating-a-listbox-and-more/58058/2 "2004-07-19T14:25:10Z")

</div>

Populate the array with the values from the ASP page and then use something like this:

```auto
labels_array = ["a", "b", "c", "d"];
for (var i in labels_array) {
	mylistbox.addItemAt(0, labels_array*, labels_array*);
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2004, 3:15pm UTC](https://forum.kirupa.com/t/dynamically-populating-a-listbox-and-more/58058/3 "2004-07-19T15:15:54Z")

</div>

sweet thanks claudio! i actually figured out how to do it exactly like you said but i appreciate your post

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2004, 3:20pm UTC](https://forum.kirupa.com/t/dynamically-populating-a-listbox-and-more/58058/4 "2004-07-19T15:20:51Z")

</div>

know of any good resources to figure out how to make it so the user’s selection from the listbox does what I want it to ?
