Results 1 to 2 of 2

Thread: [2005] AxWebBrowser Control -Fill in Textbox inside an HTML Table

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    126

    [2005] AxWebBrowser Control -Fill in Textbox inside an HTML Table

    Hi everyone, got a small question I'm hoping someone can help me out with. I found a post here by Kleinma http://vbforums.com/showthread.php?t...ght=webbrowser. Well the code there has gotten me pretty much all the way done. However, I've been jumping back and forth between the AxWebbrowser control (which is in the example used) and the Webbrowser control. So far I'm much further along in the code with the AxWebBrowser control and would like to stick with it.

    That said, i found in the example above how to fill in a textbox that on a web page. But I'm running into a problem where i cant figure out how to fill in a textbox thats inside an HTML Table? For some reason the code below only works on objects that are outside a table object. Or at least thats what i think is happening.

    Can anyone direct me in the right direction, or post a snippet of code to accomplish this? I really appreciate any help!!

    Code:
    Code:
    
      DirectCast(Me.GetCurrentWebForm.item("address"), mshtml.HTMLInputElement).value = MyClientAddress
                
    
    'Function
    Private Function GetCurrentWebForm() As mshtml.HTMLFormElement
            Try
                If GetCurrentWebDoc.forms.length > 0 Then
                    Return DirectCast(GetCurrentWebDoc.forms.item(0), mshtml.HTMLFormElement)
                Else
                    Return Nothing
                End If
            Catch ex As Exception
                Return Nothing
            End Try
        End Function
    And here is the HTML page containing the textbox I'm trying to fill in. It's the Address, city, state ones I'm interested in.


    http://stevemorse.org/jcal/latlon.php

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] AxWebBrowser Control -Fill in Textbox inside an HTML Table

    Quote Originally Posted by Mark Douglas
    Hi everyone, got a small question I'm hoping someone can help me out with. I found a post here by Kleinma http://vbforums.com/showthread.php?t...ght=webbrowser. Well the code there has gotten me pretty much all the way done. However, I've been jumping back and forth between the AxWebbrowser control (which is in the example used) and the Webbrowser control. So far I'm much further along in the code with the AxWebBrowser control and would like to stick with it.

    That said, i found in the example above how to fill in a textbox that on a web page. But I'm running into a problem where i cant figure out how to fill in a textbox thats inside an HTML Table? For some reason the code below only works on objects that are outside a table object. Or at least thats what i think is happening.

    Can anyone direct me in the right direction, or post a snippet of code to accomplish this? I really appreciate any help!!

    Code:
    Code:
    
      DirectCast(Me.GetCurrentWebForm.item("address"), mshtml.HTMLInputElement).value = MyClientAddress
                
    
    'Function
    Private Function GetCurrentWebForm() As mshtml.HTMLFormElement
            Try
                If GetCurrentWebDoc.forms.length > 0 Then
                    Return DirectCast(GetCurrentWebDoc.forms.item(0), mshtml.HTMLFormElement)
                Else
                    Return Nothing
                End If
            Catch ex As Exception
                Return Nothing
            End Try
        End Function
    And here is the HTML page containing the textbox I'm trying to fill in. It's the Address, city, state ones I'm interested in.


    http://stevemorse.org/jcal/latlon.php
    I will answer in my thread you linked from above.

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