Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

VB righting Text to Webpage

  • 12-09-2014 4:52pm
    #1
    Registered Users Posts: 2,855 ✭✭✭


    Hey Guys

    I am trying to write some code that will write text into a textarea of a webpage.
    I can't seem to get it to work. I'm new to coding and the what I am trying to get done I thought was simple enough. But my ignorance to coding has hit a road block.

    My coding looks like this (VB 2013)

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    WebBrowser1.Navigate("https:xxxxxxxxxx")
    WaitForPageLoad()

    Dim textArea As HTMLTextAreaElement

    textArea = WebBrowser1.Document.GetElementById("addbulk").DomElement
    textArea.value = TextBox1.Text

    End Sub



    The textarea I want to add to on the webpage


    <form name="bulkadd" method="post" action="?view=bulkadd">

    <p>Bulk add field:<br></p>

    <input name="view" value="bulkadd" type="hidden">

    <textarea name="bulkadd" cols="100" rows="10" onfocus="this.value = ( this.value == this.defaultValue ) ? '' : this.value;return true;">Enter CSV in the following format:

    Please enter text here
    </textarea>
    <br>

    <a href="?view=bulkadd" class="navbutton" onclick="document.submit();return false;">Submit</a>

    <a href="#" class="navbutton" onclick="document.bulkadd.reset();return false;">Clear Bulk Form</a>

    </form>


    I would like if it added the text as text box1 is filled with information. But at this stage I would be happy to just get it to populate the webpage textarea with the text that the user will put into textbox1.

    I have searched the web. But have yet to find the answer.
    Thanks in advance for any help.


Comments

  • Moderators, Science, Health & Environment Moderators Posts: 8,804 Mod ✭✭✭✭mewso


    You are using the incorrect id value in your code. WebBrowser1.Document.GetElementById("addbulk").DomElement should be WebBrowser1.Document.GetElementById("bulkadd").DomElement.


Advertisement