Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #11707

Re: fill in ie form with java

From Ulrich Möller <knobbi38@arcor.de>
Newsgroups microsoft.public.scripting.vbscript
Subject Re: fill in ie form with java
Date 2017-07-09 18:49 +0200
Organization A noiseless patient Spider
Message-ID <ojtmie$spc$1@dont-email.me> (permalink)
References <f4606ee4-abaa-49b4-9c5e-922fe8240ced@googlegroups.com> <ojtc6j$sto$1@dont-email.me> <46cdd6c3-0238-4667-95f5-2d3504fc6af6@googlegroups.com>

Show all headers | View raw


Am 09.07.2017 um 17:02 schrieb smbs:
> On Sunday, July 9, 2017 at 4:51:58 PM UTC+3, Ulrich Möller wrote:
>> Am 09.07.2017 um 10:31 schrieb smbs:
>>> 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 &amp; 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
>> This code should work:
>>     oIE.Document.getElementsByName("country")(0).Value = "RU"
>> or
>>     oIE.Document.All("country").Value = "RU"
>>
>> but maybe you have any security issues. In doubt, post a snipped on how
>> you create and access the IE object.
>>
>> Ulrich
> Thanx for reply however what you suggested does not work- no security issues as other text blocks are filled in without problems
I have tested both variations with a little test program and it works as 
expected. Check for any typo in your element names. You also have the 
option to set a break point in your vb code and try to change the value 
in the direct window.

Ulrich

Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

fill in ie form with java smbs <stevenbe@gmail.com> - 2017-07-09 01:31 -0700
  Re: fill in ie form with java "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-07-09 04:57 -0400
  Re: fill in ie form with java Ulrich Möller <knobbi38@arcor.de> - 2017-07-09 15:52 +0200
    Re: fill in ie form with java smbs <stevenbe@gmail.com> - 2017-07-09 08:02 -0700
      Re: fill in ie form with java Ulrich Möller <knobbi38@arcor.de> - 2017-07-09 18:49 +0200
  Re: fill in ie form with java JJ <jj4public@vfemail.net> - 2017-07-09 23:34 +0700
  Re: fill in ie form with java "Mayayana" <mayayana@invalid.nospam> - 2017-07-09 13:46 -0400

csiph-web