Dynamic Drop Down lists populated with single value as default not showing until down arrow clicked. | Community
Skip to main content
LucreciousDFF
Level 4
March 21, 2022
Solved

Dynamic Drop Down lists populated with single value as default not showing until down arrow clicked.

  • March 21, 2022
  • 1 reply
  • 653 views

I have over 1600 lines of code to set items to a drop down. In some cases the subsequent drop down only has a single value. I am trying to get the value to show without the user having to click the down arrow. I have tried various events to achieve this. I am using rawValue instead of setItems for those selections which only populate the subsequent drop down with a single option. The client would like the subsequent drop-down to have the singular value show and set the field to readOnly and focus on the third drop down. So far, I have the singular value working but it requires the user to click the down arrow, and, I cannot set the drop-down to readOnly if the field does not show the singular item. So, is there a way to script the down button on a drop-down from another field or the same field?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by radzmar

You can set the selectedIndex property to change the value of a dropdown list. It takes a 0-based integer to select the nth item from the dropdown list.

 

// Select the third item
DropdownList.selectedIndex = 2;

1 reply

radzmar
radzmarAccepted solution
Level 10
March 21, 2022

You can set the selectedIndex property to change the value of a dropdown list. It takes a 0-based integer to select the nth item from the dropdown list.

 

// Select the third item
DropdownList.selectedIndex = 2;