Results 1 to 7 of 7

Thread: Form Filling Help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2009
    Posts
    435

    Form Filling Help

    I want to fill forms in a WebBrowser. Is there any other way to do it other then
    Code:
    WebBrowser1.Document.GetElementByID("Name").SetAttribute("value","Text")
    ?
    The reason I dont wanna use that is because the ID Names will differ.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,415

    Re: Form Filling Help

    do you have the name of the element?

  3. #3
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Re: Form Filling Help

    well obviously the ID's will be different. you can't have things in HTML with the same ID otherwise, how would you reference them?

    What is it that you're trying to do?

    That's really the only way to fill input fields (easiest way actually) or you can capture the collection of hyperlinks into an array and iterate through looking for the correct ID name or other attribute and set its value accordingly

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,415

    Re: Form Filling Help

    vb Code:
    1. WebBrowser1.Document.All("name").innertext = "your text"

  5. #5
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Re: Form Filling Help

    not seeing the difference there paul
    everything will still have a unique name, therefore requiring multiple value assignments

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2009
    Posts
    435

    Re: Form Filling Help

    Quote Originally Posted by .paul. View Post
    vb Code:
    1. WebBrowser1.Document.All("name").innertext = "your text"
    Is there anyway to attempt to get the Elements name? For example, if I was trying to fill a "First Name" textbox, how would I find the Element ID of "First Name"?

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2009
    Posts
    435

    Re: Form Filling Help

    bump.

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