1
<tr>
  <td colspan="2" style="text-align: center;">
    <a href="javascript:start_form_submit('SUBMIT');">
      <imgsrc="graphics/proceed_confirm.gif" width="251" height="27" alt="Proceed to Confirmation" border="0">
    </a>
  </td>
</tr>

How to click in this button using delphi?

2 Answers 2

3

That is not a button, in the strictest sense of the word. It is just an image inside of a clickable hyperlink.

In any case, neither HTML element has and name or id specified, so you have your work cut out for you. You have to start by querying the WebBrowser.Document for the IHTMLDocument2 interface and then dig through the browser's DOM interfaces as needed looking for the <a> element you are interested in, then you can call its click() method.

Sign up to request clarification or add additional context in comments.

Comments

1

thanks bro, im using

function

procedure ExecuteScript(doc: IHTMLDocument2; script: string; language: string);
begin
  if doc <> nil then
  begin
    if doc.parentWindow <> nil then
      doc.parentWindow.ExecScript(script, Olevariant(language)) ;
  end;
end;

and using on button1

script := 'javascript:start_form_submit("SUBMIT");';
ExecuteScript(webbrowser1.Document as IHTMLDocument2, script, 'javascript');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.