# Set value/s for a multiselect dropdown field using Javascript

**URL:** <https://forums.knack.com/t/set-value-s-for-a-multiselect-dropdown-field-using-javascript/15051>\
**Category:** Ask Developers\
**Created:** [October 26, 2023, 4:20am UTC](https://forums.knack.com/t/set-value-s-for-a-multiselect-dropdown-field-using-javascript/15051 "2023-10-26T04:20:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nelo](https://avatars.discourse-cdn.com/v4/letter/n/c2a13f/32.png) [@Nelo](https://forums.knack.com/u/Nelo)\
**Post date:** [October 26, 2023, 4:20am UTC](https://forums.knack.com/t/set-value-s-for-a-multiselect-dropdown-field-using-javascript/15051/1 "2023-10-26T04:20:47Z")

</div>

I’m writing a script that sets values for a multiselect dropdown field but I can’t figure out how to do it. Selecting the option for the select field via $(‘select option[value=“This value”]’).attr(‘selected’, 1) works but the selected value doesn’t show up on the dropdown field display. The code above also doesn’t trigger the display rules associated with the dropdown field.

I’d appreciate any help regarding this. Thank you so much!
