Welcome Guest Search | Active Topics | Sign In | Register

WEBBROWSER DOM ELEMENT Options
DEVER
Posted: Monday, January 14, 2019 8:52:54 AM
Rank: Newbie
Groups: Member

Joined: 1/11/2019
Posts: 1
Hello,

is it possible to manipulate the html (EO.WebBrowser.DOM.Element ()) via code behing?
Events: click, focus, set value. ???
eo_support
Posted: Monday, January 14, 2019 10:35:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,072
Hi,

You will need to do it with JavaScript and then call WebView.EvalScript to run the script. For example, the following code would set a textbox's value:

Code: C#
webView1.EvalScript("document.getElementById('textbox1') = 'abc';");


Here the JavaScript code is:

Code: JavaScript
document.getElementById("textbox1").value = "abc";


That's the code that actually set the textbox's value. For other task is the same. The basic rule is for anything outside of the WebView, you do it using your .NET code (C#/VB), for anything inside the WebView you would do it through JavaScript.

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!



You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.