Expand my Community achievements bar.

set a an item as selected drop-down list javascript

Avatar

Level 4
Hy,



Is there a way to set an item in an drop-down list as the selected throw javascript??



RonnyR
4 Replies

Avatar

Level 4
Maybe in a little better Englisch:



Is ther a way to set an item in an drop-downlist as the selected with javascript?



RonnyR

Avatar

Level 5
Ronny:

Try setting the 'formattedValue' property of the drop-down field to the desired value.



DropDownField.formattedValue = "This One";



Mark

Avatar

Former Community Member
I'm trying to do the same thing, I think, and I can't get it to work.



I have a dropdown box to select the type of weld: groove or fillet.



There are several other dropdown boxes with various weld parameters. If fillet is selected in the first box, I want the groove parameter boxes to be filled with "N/A". Likewise, if groove is selected, I want the fillet parameter boxes to be filled with "N/A".



Any suggestions??

Avatar

Level 5
Sarah:

In the Change Event of the first box (filletParameterBox), Set grooveParameterBox.rawValue = "N/A";

In Change Event of grooveParameterBox, Set filletParameterBox.rawValue = "N/A";



If you really want to remove the option to select anything else in the "N/A" dropdown, you can clear the items out of the list first.



filletParameterBox.clearItems();



Then set the rawValue to what you desire.