• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1642
  • Last Modified:

Submit button in webbrowser - VISUAL BASIC 6

Hello, i want to automate the process of submitting a form within the webbrowser1 in my visual basic project.

I want a code which will do something like this,

If a submit button exist on the page with the Value of "Send" or "Submit" then submit that button.

So far i have this,

WebBrowser1.Document.All("submit").Click

Thank you
0
SDfatha
Asked:
SDfatha
  • 3
1 Solution
 
vb_elmarCommented:
The following sample scans the web page for all input elements.

If the input element has the Value of "Send" or "Submit" it will be clicked.
3.zip
0
 
vb_elmarCommented:
Private Sub Command2_Click()

For Each virtualButton In WebBrowser1.Document.getElementsByTagName("input")

If virtualButton.Type = "submit" Then
      isSUBMIT = virtualButton.Value = "Send" Or virtualButton.Value = "Submit"
      If isSUBMIT = True Then virtualButton.Click: Exit For
End If

Next virtualButton

End Sub
0
 
vb_elmarCommented:
Today the webmaster of fastemailsender has changed the caption of the "Send" button,

The caption of the "Send" button is now "Send message".
0
 
Martin LissRetired ProgrammerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now