|
-
Jun 25th, 2001, 05:21 PM
#1
Automatically fill out IE form fields?
Hi.
I need a code sniplet that will automaticallyu insert text into form fields in a browser window (I don't care if it's a browser opened outside the application, or a BrowserControl object in the program, either works for me). You click a button in the program, and the program would fill out the form that is n the page in teh browser. How can this be done? Your help is really appreciated.
-
Jun 25th, 2001, 06:10 PM
#2
Not sure this is what you are looking for, but if you do:
<input type="text" name="myfield" value="This text will appear"> Then the user will see "This text will appear" in the textfield. Now, how you get that text is up to you.
Again, not sure if that is what you mean.
-
Jun 26th, 2001, 10:06 AM
#3
Frenzied Member
You can use the webbrowser control and use a loop with something like this:
Code:
For r = 0 To webbrowser.Document.Forms(Form).length - 1
If webbrowser.Document.Forms(form)(r).Name = "q" Then
webbrowser.Document.Forms(form)(r).Value = "Whatever"
End If
Next
-
Jun 26th, 2001, 02:39 PM
#4
Ehh...
Hi.
Thanks. It works for ask.com and stuff, but on some sites it tells me:
Run-time error '91' Object bariable or With variable not set.
How do I get around this? Thanks.
-
Jun 26th, 2001, 05:01 PM
#5
Frenzied Member
To be honest with you, I am not all that familiar with this, I have only used it a couple times and can't find any documentation on it. I think the problem you are experiencing, and I have too, is when there is more that one form on a page. Sorry I couldn't be of more help, I would just try playing around with it a little further.
-
Jun 26th, 2001, 09:15 PM
#6
Anyways, thanks for your trouble. The pages that give me error messages only appear to have one form on them. However, I always get the error when I try to fill out a form in a document that contains more than one frame. I think that's the problem. I played with it for nearly 3 hours, but I was unable to get it to work. Would there be a way to fix this error? Or maybe there's a way to fill out fields in an alredy-open IE window? (I don't care weather it's a window or a WebBrowser object, just as long as it works). Maybe you could direct me to a resource which would help me? Any help would be appreciated.
-
Jun 27th, 2001, 08:50 AM
#7
Frenzied Member
You could always use SendKeys and Tab through the page
-
Jun 27th, 2001, 10:51 AM
#8
Thank you. That's probably what I'll do.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|