user1512094
user1512094

Reputation: 621

Send OnClick message to TWebBrowser

How can I send a mouse onclick message to TWebBrowser in Delphi? The OnClick message must be sent to specific control appears in website.

for Example i have a radio button appears in the website named XXXRB and I want send the message to that Radio button (which is named XXXRB) to select it.

How can I do it?

Regards.

Upvotes: 2

Views: 2444

Answers (2)

whosrdaddy
whosrdaddy

Reputation: 11860

No need for javascript as Arioch implies. You can have access to the complete DOM via TWebBrowser.Document. There are many resources on the net on this subject, this is the most complete one:

http://www.cryer.co.uk/brian/delphi/twebbrowser/read_write_form_elements.htm

if you look around on SO you also will find some snippets.

Upvotes: 2

Arioch 'The
Arioch 'The

Reputation: 16045

can you call JS from Delphi ?

http://www.delphidabbler.com/articles?article=21

http://jansfreeware.com/articles/delphi-ie-javascript.html

http://www.programmersheaven.com/article/12946-How+to+call+JavaScript+functions+in+a+TWebBrowser+from+Delphi/info.aspx


probably there should be way

http://www.roseindia.net/javascript/javascript-click-method.shtml


To locate the control DOM Object you may try collections such as GetXXXByName or libraries like jQuery or custom JS code.

however that is the question on Internet Epxlorer + JavaScript, not on Delphi.

Upvotes: 3

Related Questions