Link to home
Create AccountLog in
Visual Basic Classic

Visual Basic Classic

--

Questions

--

Followers

Top Experts

Avatar of mcwalters
mcwalters

Webbrowser Control form submission using an image
I'm need to automate form submission for a project I'm working on.
I've got basic form filling working ok, but i need to be able to simulate a click on a specific image which will submit the form.

The form I'm trying to access is here:

http://nos.dhlgroup.co.uk/booking/wrd/run/WB_LOGIN_PW.entryPoint

and I need to be able to click on the continue button (not just submit the form)

I have the following code but am not sure how to click the image to proceed:

Webbrowser1.Navigate ("http://nos.dhlgroup.co.uk/booking/wrd/run/WB_LOGIN_PW.entryPoint")
Webbrowser1.Document.Forms(0).Item("USER_ID.USER.DUM").Value = "username"
Webbrowser1.Document.Forms(0).Item("PASS.USER.DUM").Value = "password"

Thanks

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of bingiebingie

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of mcwaltersmcwalters

ASKER

Great, that worked nicely. But...

I need to fill in around 5 forms sequentially, in just the same way, but  VB tries to submit the next form before the current one is finished. Here's what I have now:

WebBrowser1.Navigate ("http://nos.dhlgroup.co.uk/booking/wrd/run/WB_LOGIN_PW.entryPoint")

While (WebBrowser1.ReadyState <> READYSTATE_COMPLETE)
    DoEvents
Wend

WebBrowser1.Document.Forms(0).All("USER_ID.USER.DUM").Value = "username"
WebBrowser1.Document.Forms(0).All("PASS.USER.DUM").Value = "password"
WebBrowser1.Document.Forms(0).All("CONTINUE.BUTTONS.BUTTONS").Click

While (WebBrowser1.ReadyState <> READYSTATE_COMPLETE)
     DoEvents
Wend

WebBrowser1.Document.Forms(0).All("BOOK.DUM_BUTTONS.XBOOKING").Click


I would have thought that this would have waited before running each request, but as soon as the initial request is completed, it tries to submit both the forms at the same tima and obviously generates an error! Any ideas how better to do this? Thanks

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Visual Basic Classic

Visual Basic Classic

--

Questions

--

Followers

Top Experts

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.