Avatar of rjef
rjef
Flag for United States of America asked on

VB6 webbrowser control and java script command needed.

inspect element is below
<input type="checkbox" data-role="none">
i was able to use the below vb6 code/java  to check the element checkbox

WebBrowser1.Navigate2 ("javascript:document.querySelectorAll(""input"")[3].click();")

now i have the below inspect element

<input name="Nameit" class="cat_item_option sc-content-pad form-control" id="Nameit" onchange="if (typeof(variableOnChange) == 'function') variableOnChange('Nameit')" maxlength="0000000000" value="">

need vb6 webbrowser control/java command enter  a'Joe Smith' into the element textbox
* vb6JavaScript

Avatar of undefined
Last Comment
Zakaria Acharki

8/22/2022 - Mon
leakim971

WebBrowser1.Navigate2 ("javascript:document.getElementsByName(""Nameit"")[0].value=""Joe Smith"";")

Open in new window

ASKER CERTIFIED SOLUTION
Zakaria Acharki

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
rjef

ASKER
This worked
WebBrowser1.Document.getElementById("Nameit").value="Joe Smith"

any idea how to click on the elemement?
<span class="ui-btn-text">Ok</span>
Zakaria Acharki

Try to use the click event like :

WebBrowser1.Document.querySelector(".ui-btn-text").click();
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
rjef

ASKER
not valid syntax
Zakaria Acharki

My bad check my update in the previous comment (adding the dot '.' Before class name)