# How to set \<select\> dropdown in oneditprepare?

**URL:** <https://discourse.nodered.org/t/how-to-set-select-dropdown-in-oneditprepare/77016>\
**Category:** Developing Nodes\
**Created:** [28 March 2023 11:25 UTC](https://discourse.nodered.org/t/how-to-set-select-dropdown-in-oneditprepare/77016 "2023-03-28T11:25:22Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![cameo69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cameo69/32/66593_2.png) [@cameo69](https://discourse.nodered.org/u/cameo69)\
**Post date:** [31 March 2023 16:11 UTC](https://discourse.nodered.org/t/how-to-set-select-dropdown-in-oneditprepare/77016/21 "2023-03-31T16:11:10Z")

</div>

You are right. It did not trigger my change handler. And if there is a normal one, probably that did it.

---

<div class="post-metadata">

**Author:** ![cameo69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cameo69/32/66593_2.png) [@cameo69](https://discourse.nodered.org/u/cameo69)\
**Post date:** [1 April 2023 11:37 UTC](https://discourse.nodered.org/t/how-to-set-select-dropdown-in-oneditprepare/77016/22 "2023-04-01T11:37:03Z")

</div>

> [@ebarrieau](#):
>
> `$("#node-input-drop_select").val("drop").trigger("change")`

After reading more about it on the internet, it seems using val combined with calling change() is the correct answer. Hence marking it as the solution for future reference.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 April 2023 11:37 UTC](https://discourse.nodered.org/t/how-to-set-select-dropdown-in-oneditprepare/77016/23 "2023-04-15T11:37:28Z")

</div>

Closed on 15 April 2023 11:37 UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/how-to-set-select-dropdown-in-oneditprepare/77016.md?page=1)
