Results 1 to 2 of 2

Thread: [RESOLVED] Using Webbrowser to Change Textarea

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Location
    palo alto california
    Posts
    45

    Resolved [RESOLVED] Using Webbrowser to Change Textarea

    Hi,

    I want to prefill a form on a web page.
    I created a form with a webbrowser1 on it. Navigated to the site. Worked in the sub Document completed. So no beginning problem.

    I can change simple textboxs on the web page.
    Looking at the source of the html for example I have

    <input type="text" name="name" value="" maxlength="25" tabindex=1>

    VB Code:
    1. Dim mobius As System.Windows.Forms.HtmlDocument = Me.WebBrowser1.Document
    2.     mobius.All("name").OuterText = "Stephen"

    Perfect.... It works...

    Now the problem is there is a TextArea on this form that has source:

    <textarea name="message" cols=65 rows=15 wrap=virtual tabindex=4 tindex=4></textarea>
    <script language="javascript" src="/textarea/editor.js"></script>
    <script language="javascript"><!--
    var config = new Object();
    config.toolbar = [........
    ..... ];
    editor_generate('message', config); --></script>

    I tried the obvious with the name="message" as
    VB Code:
    1. mobius.All("message").OuterText = "Once upon a Time..."

    But it didn't put it in the textarea, and gave me a script error (yes/no).


    Is there any way to add text programatically to textareas much like this one with all the buttons and smilies?"

    '

  2. #2

    Thread Starter
    Member
    Join Date
    Jun 2005
    Location
    palo alto california
    Posts
    45

    [RESOLVED]Using Webbrowser to Change Textarea

    I Love Programming. I Love you guys.

    Sorry.

    I spent ten hours, fiddling with code. Searching the web. Suspecting all along that the solution must be EASY---OBVIOUS..

    And it was.

    VB Code:
    1. mobius.All("message").InnerHtml = "When In the course of human events it becomes necessary for one people to dissolve the political bands which have connected them with another and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature's God entitle them, a decent respect to the opinions of mankind requires that they should declare the causes which impel them to the separation."

    Thanks Anyway. Just posting to this Forum allowed the Karma of this place to give me the answer I was looking for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width