+ Reply to Thread
Results 1 to 1 of 1

Submitting web form resets the form

  1. #1
    Registered User
    Join Date
    09-12-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1

    Submitting web form resets the form

    Hi I am having problem while submitting form for search on this Website.
    http://www.hcdistrictclerk.com/edocs/public/search.aspx
    My code seems to work for filling in the form.
    However after, it tries to click the search button, the forms seems to be cleaned and no result return.
    When I delete that particular line :.all("ctl00$ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder2$ContentPlaceHolder2$btnSearch").Click
    and click the search button manually, everything seems to be fine.
    Any one can help me?


    My code:

    Sub test()
    Dim searchURL, entity, paintiff, defendent As String
    Dim i, k As Integer
    plaintiff = "ctl00$ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder2$ContentPlaceHolder2$tabSearch$tabCivil$txtPlaintiff"

    k = Sheet1.Range("a65536").End(xlUp).Row

    Set IE = CreateObject("internetexplorer.application")
    Web_Address = "http://www.hcdistrictclerk.com/edocs/public/search.aspx"

    ' Access the Webpage
    IE.Navigate Web_Address
    IE.Visible = True
    Start:

    ' Wait while IE loading...
    Do While IE.Busy
    Application.Wait DateAdd("s", 5, Now)
    Loop

    For i = 1 To k
    entity = Cells(i, 1)

    With IE.document.forms(0)
    .all(plaintiff).Value = entity
    .Submit

    .all("ctl00$ctl00$ctl00$ContentPlaceHolder1$ContentPlaceHolder2$ContentPlaceHolder2$btnSearch").Click

    'This line seems to reset the form before submitting for search
    'So it gives me no result
    'If I delete this line and click the search button manually, everything works fine

    End With
    Next i



    End Sub
    Last edited by lynn00lynn; 09-12-2014 at 02:13 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Form nightmare - project resets = global variables lost
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-30-2014, 11:36 PM
  2. On submitting form, automatically go to next blank row.
    By mynameismichael in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2014, 04:08 PM
  3. Use form submission to enter data both in the form and not in the form
    By tsamuels in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2013, 10:06 PM
  4. Submitting web form (cannot target submit button)
    By carlofardella in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2013, 11:20 AM
  5. Filling form fields via worksheet dropdowns, user update via form, change form color
    By Demosthenes&Locke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2010, 08:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1