# Dropdown reset selected value to default

**URL:** <https://forum.inductiveautomation.com/t/dropdown-reset-selected-value-to-default/18556>\
**Category:** Ignition\
**Created:** [June 21, 2018, 1:03pm UTC](https://forum.inductiveautomation.com/t/dropdown-reset-selected-value-to-default/18556 "2018-06-21T13:03:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [June 21, 2018, 1:03pm UTC](https://forum.inductiveautomation.com/t/dropdown-reset-selected-value-to-default/18556/1 "2018-06-21T13:03:47Z")

</div>

In component scripting how would you reset a dropdowns selected value back to default (-1)?

---

<div class="post-metadata">

**Author:** ![Stuart](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Stuart](https://forum.inductiveautomation.com/u/Stuart)\
**Post date:** [June 21, 2018, 1:09pm UTC](https://forum.inductiveautomation.com/t/dropdown-reset-selected-value-to-default/18556/2 "2018-06-21T13:09:15Z")

</div>

You could do just that.

```auto
event.source.parent.getComponent('Dropdown').selectedValue = -1

```

If the dropdown, and a button are on the same level (both on rootcontainer, etc.) then putting this script on the button press will reset the dropdown.

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [June 21, 2018, 1:16pm UTC](https://forum.inductiveautomation.com/t/dropdown-reset-selected-value-to-default/18556/3 "2018-06-21T13:16:41Z")

</div>

that worked. Thanks for the help
