Welcome Guest Search | Active Topics | Sign In | Register

Automatically set focus to first text input field Options
tmigh
Posted: Friday, June 17, 2016 6:12:36 PM
Rank: Member
Groups: Member

Joined: 1/16/2016
Posts: 16
Hello,

I'm a paying customer.

I would like to ask how I configure EO webbrowser so that the first input textbox is automatically focussed when the page finished loading.

For example when I navigate to www.google.com, I would like the focus to be in the google search text box.

Also, I would like to prevent losing focus from the EO webbrowser when any other control on my WinForm is clicked.

How can this be accomplished?

Thank you!
tmigh
Posted: Sunday, June 19, 2016 4:23:46 PM
Rank: Member
Groups: Member

Joined: 1/16/2016
Posts: 16
I have purchased a license for EO webbrowser.
Could I please get a reply from the authors about my question?
If my question should be outside the supportable area, please tell me as well.

Thank you very much.
eo_support
Posted: Sunday, June 19, 2016 11:28:56 PM
Rank: Administration
Groups: Administration

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

You will need to do that with JavaScript and then call the code through WebView.EvalScript. For example, the following code set the focus to "textbox1":

Code: C#
WebView.EvalScript("document.getElementById('textbox1').focus();");


If you want the code to run after the page has finished loading, then you can handle your window object's load event to do so. Note that this may conflicts with existing code in the page (for example, the page may have code to set focus to textbox2 when the page finishing loading while you try to set focus to textbox1 when the page finishes loading). In that case it may not work properly.

Hope this helps.

Thanks!
tmigh
Posted: Wednesday, June 22, 2016 8:11:13 PM
Rank: Member
Groups: Member

Joined: 1/16/2016
Posts: 16
Thank you.


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.