Results 1 to 5 of 5

Thread: [RESOLVED] web browser control question

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    3

    Resolved [RESOLVED] web browser control question

    I am attempting to click a button on a web page through vb. I am using
    WebBrowser.Document.documentElement.all("textboxname").Value = "something"
    to fill in text boxes. The button i need to click displays like this in the HTML:

    <INPUT tabIndex=15 type=image height=22 alt=submit width=46 src="ts_btn_submit.gif" border=0>


    How would I click this button using WebBrowser.Document.documentElement.all, or any other way...I have been using SendKeys, I don't like this option because it counts on the form in focus which isn't always the case. and i can't post it myself because of the html formatting...i just need to figure out how to click this button....

    who ever takes pitty on me and helps out...thanks.

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: web browser control question

    if this doesnt work.. (which i doubt it will)

    Webbrowser1.Document.All.Submit.Click


    then you will need to loop through all the input elements

    VB Code:
    1. Dim I_Elem as Object
    2. On Error Resume next
    3. For each I_Elem in Webbrowser1.Document.GetElementsByTagName("input")
    4. If I_Elem.alt = "submit" Then
    5.     I_Elem.Click
    6.     Exit For
    7. End If
    8. Next
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    3

    Re: web browser control question

    worked! u saved my life!

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: web browser control question

    Woah! I didnt know lives were at stake with this one!!

    phew!


    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: web browser control question

    Can you do us a favor?

    Click thread tools > Mark Thread resolved

    that will let everyone know u have had your question answered.
    Thanks!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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