# Clearing a listbox

**URL:** <https://forum.kirupa.com/t/clearing-a-listbox/12248>\
**Category:** Uncategorized\
**Created:** [January 28, 2003, 10:09pm UTC](https://forum.kirupa.com/t/clearing-a-listbox/12248 "2003-01-28T22:09:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimw00d](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@jimw00d](https://forum.kirupa.com/u/jimw00d)\
**Post date:** [January 28, 2003, 10:09pm UTC](https://forum.kirupa.com/t/clearing-a-listbox/12248/1 "2003-01-28T22:09:18Z")

</div>

How would I go about clearing selections made in a listbox.

I have experimented with clearAll() and setting values to false, but with no luck.

Any ideas??

---

<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:** [January 28, 2003, 11:18pm UTC](https://forum.kirupa.com/t/clearing-a-listbox/12248/2 "2003-01-28T23:18:21Z")

</div>

> How would I go about clearing selections made in a listbox.

RemoveButton.onRelease = function() {  
listbox.removeItemAt(listbox.getSelectedIndex());  
};

Are you trying to clear the whole listbox?

---

<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:** [January 28, 2003, 11:44pm UTC](https://forum.kirupa.com/t/clearing-a-listbox/12248/3 "2003-01-28T23:44:48Z")

</div>

I am not trying to remove any items just remove the selection of a user. When a country of origin is selected and the user hits the clear button the selection remains, i.e. the highlight that indicates the selection remains.

When the form is loaded there is no selection.

I would like to make sure the listbox has no selection when clear is hit
