views:

18

answers:

2

How can I paste a text to the text area within a form in the browser control?

I think how i have selected is correct

 browser1.Document.Forms.GetElementsByName("editform").GetElementsByName("input")

UPDATE:Here is the Html

....
<form name="editform">
<textarea name="input">
</textarea>
</form>
...
A: 

Here is an example of how it can be done based on the HTML you've provided. You must first add a reference to MSHTML via the Microsoft.mshtml. Also, I would recommed adding an id attribute to the text area then you can get to it much easier. Something along these lines.

<form name="editform"> 
    <textarea id="myTextArea" name="input"> 
    </textarea> 
</form>

Then you can set the value property of the text area.

Dim textArea As HTMLTextAreaElement

textArea = WebBrowser1.Document.GetElementById("myTextArea").DomElement
textArea.value = "Hello World!"
Garett
A: 

Figured out it's not possible due to security reasons.

esafwan