472,354 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 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 4317
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: ...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.