smbs
2017-07-09 08:31:29 UTC
I am trying to select items from a dropdown menu on a javascript webpage. I want to fill in the menu value via a userform using VB. Relevent Web code source is below
***************************************************************************************
<div class="sa-form-control sa-form-field" style="padding-bottom: 20px;">
<select name="country" class="ui-textfield ui-textfield-system sa-country sa-error-field"><option selected="selected" value="">--Please Select--</option>
<option value="RU">Russian Federation</option>
<option value="US">United States</option>
<option value="ES">Spain</option>
<option value="FR">France</option>
option value="OTHER">Other Country</option>
<option value="">-------- Country & Territories (A-Z) --------</option></select>
<div class="sa-success-icon" style="display: none;"></div><p class="sa-error-tips" style="display: block;">Please select a Country/Region</p></div>
**************************************************************************************************
I have tried the following
oIE.document.getElementsByClassName("ui-textfield ")(0).Value = "RU"
not working
oIE.document.getElementsByName("country")(0).Value = "RU"
Also not working
Any help would be great
Thanx
***************************************************************************************
<div class="sa-form-control sa-form-field" style="padding-bottom: 20px;">
<select name="country" class="ui-textfield ui-textfield-system sa-country sa-error-field"><option selected="selected" value="">--Please Select--</option>
<option value="RU">Russian Federation</option>
<option value="US">United States</option>
<option value="ES">Spain</option>
<option value="FR">France</option>
option value="OTHER">Other Country</option>
<option value="">-------- Country & Territories (A-Z) --------</option></select>
<div class="sa-success-icon" style="display: none;"></div><p class="sa-error-tips" style="display: block;">Please select a Country/Region</p></div>
**************************************************************************************************
I have tried the following
oIE.document.getElementsByClassName("ui-textfield ")(0).Value = "RU"
not working
oIE.document.getElementsByName("country")(0).Value = "RU"
Also not working
Any help would be great
Thanx