473,326 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

One last WebBrowser DOM question...

One last question and I will have my application working the way that I
need...

How can you put a value into a specific field on a specific form?

If you look at the webpage sample below you will see that there are three
forms on the page. Each form has a unique name, but the input tags are
duplicated on each form.

How would I (for example) assign the value "Bob" to the input box named
"username" on the form named "FormTwo" in VB6 using the WebBrowser DOM???

<html>
<head>
</head>
<body>
<form name="FormOne" action = "">
Name: <input type="text" name ="username"> <br>
Password: <input type="password" name="password"><br>
<input type="submit" name="submit">
</form>
<hr>
<form name="FormTwo" action = "">
Name: <input type="text" name ="username"> <br>
Password: <input type="password" name="password"><br>
<input type="submit" name="submit">
</form>
<hr>
<form name="FormThree" action = "">
Form3<br>
Name: <input type="text" name ="username"> <br>
Password: <input type="password" name="password"><br>
<input type="submit" name="submit">
</form>
</body>
</html>
Jul 17 '05 #1
3 4360
There may be an easier way than this but offhand:
You can always get anything with "all". From the
all element collection, in a loop, you can look for
elements with tagName = "INPUT", then find the
one with the right name property. They also have
a "type" property. (Text, Password, etc.)
One last question and I will have my application working the way that I
need...

How can you put a value into a specific field on a specific form?

If you look at the webpage sample below you will see that there are three
forms on the page. Each form has a unique name, but the input tags are
duplicated on each form.

How would I (for example) assign the value "Bob" to the input box named
"username" on the form named "FormTwo" in VB6 using the WebBrowser DOM???

<html>
<head>
</head>
<body>
<form name="FormOne" action = "">
Name: <input type="text" name ="username"> <br>
Password: <input type="password" name="password"><br>
<input type="submit" name="submit">
</form>
<hr>
<form name="FormTwo" action = "">
Name: <input type="text" name ="username"> <br>
Password: <input type="password" name="password"><br>
<input type="submit" name="submit">
</form>
<hr>
<form name="FormThree" action = "">
Form3<br>
Name: <input type="text" name ="username"> <br>
Password: <input type="password" name="password"><br>
<input type="submit" name="submit">
</form>
</body>
</html>

Jul 17 '05 #2

Noozer,

I once spent hours trying to figure this out. Someone on this newsgroup
told me how to do it with one line of code:

webBrowser.Document.Forms("FormOne")("username").V alue = "bob"

nate
"Noozer" <do*******@me.here> wrote in message
news:jGirc.552581$oR5.183772@pd7tw3no...
One last question and I will have my application working the way that I
need...

How can you put a value into a specific field on a specific form?

If you look at the webpage sample below you will see that there are three
forms on the page. Each form has a unique name, but the input tags are
duplicated on each form.

How would I (for example) assign the value "Bob" to the input box named
"username" on the form named "FormTwo" in VB6 using the WebBrowser DOM???

<html>
<head>
</head>
<body>
<form name="FormOne" action = "">
Name: <input type="text" name ="username"> <br>
Password: <input type="password" name="password"><br>
<input type="submit" name="submit">
</form>
<hr>
<form name="FormTwo" action = "">
Name: <input type="text" name ="username"> <br>
Password: <input type="password" name="password"><br>
<input type="submit" name="submit">
</form>
<hr>
<form name="FormThree" action = "">
Form3<br>
Name: <input type="text" name ="username"> <br>
Password: <input type="password" name="password"><br>
<input type="submit" name="submit">
</form>
</body>
</html>

Jul 17 '05 #3
Thank you VERY much!

I knew there had to be a simple way... this makes perfect sense now that I
see it.

"nate" <na**@hello.com> wrote in message
news:HZ****************@fe2.columbus.rr.com...

Noozer,

I once spent hours trying to figure this out. Someone on this newsgroup
told me how to do it with one line of code:

webBrowser.Document.Forms("FormOne")("username").V alue = "bob"

How can you put a value into a specific field on a specific form?

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matt | last post by:
Hi group, Here's a problem I've been trying to solve for the past several weeks. I have the standard WebBrowser object added to a form so it can access websites, and I have it load a default...
2
by: frederik12 | last post by:
Hi all, Today I downloaded and installed VS 2005 C# Express Edition (.NET framework 2.0). I'm very pleased about this new product. In my current application I'm using the WebBrowser control in...
4
by: ljlevend2 | last post by:
I would like to implement common edit operations (i.e., Cut, Copy, Paste, Select All and Find) in a System.Windows.Forms.WebBrowser. Are there any methods or tools for doing so? Thanks, Lance
4
by: Toma Marinov | last post by:
Hello ! I made some test with webbrowser control in VS.2005. When I load a word document in webbrowser through .Navigate method (from my hdd), I want to get the stream of the loaded doc file with...
2
by: Kurt Waldheim | last post by:
Hi, I want do download a XML file using the WebBrowser class. How can I prevent that the file is converted to HTML code using a stylesheet. Thanks,Kurt
9
by: philip | last post by:
Is it possible, on a WebBrowser control, to intercept a HyperLink and react programmatically to this click ? That's my first question. In fact, I use the Webbrowser as a sort of report (I write...
2
by: Ryan Ramsey | last post by:
I have been chasing this one down for a week and have narrowed it down to a machine issue. I have the following code: webBrowser.Navigate(http://finao.net/post_dkp.php?database=40); Basically...
11
by: kimiraikkonen | last post by:
Hi there, I needed to use MouseOver event on Webbrowser which is NOT provided by webbrowser control natively(what a disappointment), so i decided to go with another route to simulate this like: ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.