Link to home
Start Free TrialLog in
Avatar of rjef
rjefFlag 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
Avatar of leakim971
leakim971
Flag of Guadeloupe image

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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Zakaria Acharki
Zakaria Acharki
Flag of Morocco image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 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>
Try to use the click event like :

WebBrowser1.Document.querySelector(".ui-btn-text").click();
Avatar of rjef

ASKER

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