Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

web browser question

how would I direct a web browser control to set focus to a specific button on a web page?
For example, to click the "Sign In" button a login page using API.
Any ideas would be very helpful. :confused:
Thanks
[236 byte] By [freqsoft] at [2007-11-11 10:14:41]
# 1 Re: web browser question
possibly set that up on the page itself? thats the first place i would look. hope that helps.
vchatlive at 2007-11-11 17:22:51 >
# 2 Re: web browser question
There isn't a single script out there to scan a webpage for button with a specific caption or window handle and execute a keypress on it? :SICK:
freqsoft at 2007-11-11 17:23:51 >
# 3 Re: web browser question
or how to get the window handle of a textbox or button inside a web browser control in Visual Basic?
freqsoft at 2007-11-11 17:25:00 >
# 4 Re: web browser question
yeah thats what i mean, scan the page, using a javascript or something similar, dont use the vb6 form to find it. that way when the browser loads it automatically runs all the code for the page as well ;)
vchatlive at 2007-11-11 17:25:54 >
# 5 Re: web browser question
I've done similiar modifying yahoo java-chat environments. Saving the original chat page and modifying it so it's still functional + some added scripts.

What's a good javascript to allocate window focus to textboxes in html forms?
freqsoft at 2007-11-11 17:27:04 >
# 6 Re: web browser question
I've made a pretty big break-thru, but I'd still like to know how to do it in visual basic, so I can affect a page without having to edit it.

Is there a visual basic version of this javascript:

function placeFocus() {
if (document.forms.length > 0) {
var field = document.forms[0];
for (i = 0; i < field.length; i++) {
if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
document.forms[0].elements[i].focus();
break;
}
}
}
}
freqsoft at 2007-11-11 17:28:03 >
# 7 Re: web browser question
Anyone?
freqsoft at 2007-11-11 17:28:58 >
# 8 Re: web browser question
Nobody knows... UR SCARED
freqsoft at 2007-11-11 17:30:02 >