I have the following html code:
Code
<span id='connectionpoints_displaytype_fs' data-fieldtype="select" class='listcontrol nldropdown' style="white-space:nowrap;">
<div class="dropdown"
data-name="displaytype"
data-initialized="F"
data-options="[{"value":"VALUE1","text":"Value 1"},{"value":"VALUE2","text":"Value 2"},{"value":"VALUE3","text":"Value 3"},{"value":"VALUE4","text":"Value 4"},{"value":"VALUE5","text":"Value 5"}]"
data-default-option="0"
data-settings="{"flags":-2147483520,"width":-1,"minWidth":-1,"mandatory":true}"
style="display: none; ">
</div>
<input name="inpt_displaytype"
type="text"
value=" "
class="dropdownInput textbox"
onkeydown="getDropdown(this).handleKeydown(event);"
onkeypress="getDropdown(this).handleKeypress(event);"
onfocus="getDropdown(this).handleOnFocus(event);"
onblur="getDropdown(this).handleOnBlur(event);"
aria-labelledby="connectionpoints_displaytype_fs_lbl"
autocomplete="off"
contenteditable="false"
role="combobox" />
<span class="ddarrowSpan">
<img src="/uirefresh/img/field/dropdown.png" height="20" width="20" class="i_dropdownarrow" alt="More Options"/>
</span>
<input name="displaytype"
type="hidden"
class="nldropdown"
value=""
onchange="if (Syncdisplaytype(true,null,null,null,null,null) == false) return false;connection_machine_synclinefields();;setMachineChanged('connectionpoints',this);" />
<input type="hidden" value="0"/>
<script type="text/javascript">
(function () {
var win = (window.parentAccesible != false && parent.initializeDropdowns) ? parent : window;
win.initializeDropdowns(win.NS.jQuery(document));
}())
</script><span class='field_widget_helper_pos effectStatic'></span></span>
</span>
Display More
I'm trying to select from one of the values in the dropdown. I've tried different codes but I can't seem to make it work. I've tried setting the values, triggering events, looping the options, etc. I'm not sure what I'm doing wrong. I was able to populate the other fields like text boxes in the page using the usual getElementsByName and using obj.Value = "Sample" but I'm having a hard time if it's a dropdown.