Solved

Click in web page button without mouse

Posted on 2012-04-10
2
686 Views
Last Modified: 2012-04-10
Thank you for help.
Iam using delphi XE.
and have the button in web page with this code
<input value="Send This" type="submit">

Open in new window


how do i click in this web button using TWEBBROWSER?
any trick?

thank you.
0
Comment
Question by:adminmember
2 Comments
 
LVL 22

Accepted Solution

by:
Ferruccio Accalai earned 500 total points
ID: 37830095
procedure TForm1.Click;
var
  ovElements: OleVariant;
  i: Integer;
begin
  ovElements := WebBrowser1.OleObject.Document.forms.item(0).elements;
  for i := 0 to (ovElements.Length - 1) do
    if (ovElements.item(i).tagName = 'INPUT') and
      (ovElements.item(i).type = 'SUBMIT') and
      (ovElements.item(i).Value = 'Send This') then
   begin
      ovElements.item(i).Click;
      break;
   end;
end;
0
 

Author Closing Comment

by:adminmember
ID: 37830550
ps: the submit is lowercase.
and now its works...
Thank You a lot.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 96
SUM 2 INTEGER ARRAYS INTO 1 10 100
how to resize animated Gif image in delphi ? 1 31
PHP preg_replace code convert to Delphi 14 57
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question