如何在JavaScript中设置dropdownlist的选定值。Sharepoint列表表单

如何在JavaScript中设置dropdownlist的选定值。Sharepoint列表表单,javascript,sharepoint-2010,drop-down-menu,Javascript,Sharepoint 2010,Drop Down Menu,我想在Sharepoint列表表单中设置Dropdownlist的选定值 我可以使用 getField('select','County').selectedIndex = 1; 在这里,它设置在索引1处选择的默认值 但我想使用文本设置值,即一些“Abc” 我试过了 getField('select','County').selectedValue = "Abc"; getField('select','County').selectedText = "Abc"; 但这两种方法都不适用于我

我想在Sharepoint列表表单中设置Dropdownlist的选定值

我可以使用

 getField('select','County').selectedIndex = 1;
在这里,它设置在索引1处选择的默认值

但我想使用文本设置值,即一些
“Abc”

我试过了

getField('select','County').selectedValue = "Abc";
getField('select','County').selectedText = "Abc";

但这两种方法都不适用于我。是否有任何其他属性可以使用JS设置dropDownlist的值Hi请查看此演示


您可以在Droop下拉列表中添加值,也可以通过传递文本值使用javascript选择值。您好,请查看此演示

您可以在Droop下拉列表中添加值,也可以使用javascript和传递文本值来选择值