Results 1 to 3 of 3

Thread: auto fill on the web forms..

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    38

    auto fill on the web forms..

    I'm still some trouble and not get anywhere, I'm writing program of automatically fill out the forms for (first name and last name and home addresss) on the web browser by click one button and automatically fill out, I'm not sure how i can write code in VB. Does any one can help me how to write that so i can undersand myself from there thanks.

  2. #2
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: auto fill on the web forms..

    This will log you into gamespot, might gets some ideas fom it,
    VB Code:
    1. Option Explicit
    2.     Private WithEvents strtxtBox    As HTMLTextAreaElement
    3.     Private IE                      As InternetExplorer
    4.     Private WithEvents strEmail     As HTMLTextAreaElement
    5.     Private Sub Command1_Click()
    6.         Set IE = New InternetExplorer
    7.         With IE
    8.             .Visible = True
    9.             .navigate "www.gamespot.com"
    10.         End With
    11.         Do Until IE.ReadyState = READYSTATE_COMPLETE
    12.             DoEvents
    13.         Loop
    14.         Set strtxtBox = IE.document.Forms(0).PASSWORD
    15.         Set strEmail = IE.document.Forms(0).EMAILADDR
    16.         strtxtBox.innerText = "pass"
    17.         strEmail.innerText = "[email protected]"
    18.         IE.document.frames.execScript "document.login.submit()", "JavaScript"
    19.     End Sub
    Creates a new instance of IE but can use it with the WB control, change a couple of lines.

    You need to set references for "Microsoft Internet controls" and "Microsoft HTML Object library".
    CS

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

    Re: auto fill on the web forms..

    you dont need the withevents ....
    (dont even need the HTML object in some cases)

    using the webbrowser control

    Webbrowser1.Document.All.NAMEOFFIELD.Value = "Data"

    so, if in the HTML source of the page.. u see the text field Name="fName" then

    Webbrowser1.Document.All.fName.Value = "Data"

    to submit
    Webbrowser1.Document.All.submit.Click

    usually works.

    now u can get really deep into things sometimes.. all depends on the page being filled.

    post the URL and I will help more in the am
    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