Fill a field on a web page in TWebBroswer Delphi 7

2019-02-25 19:11发布

问题:

I'm making a small program to place orders on our supplier's web site. I need to fill 3 fields in the page. Don't even need to "submit" it.

Is there any simple way or any component that could do that (preferably free)

Thank you!

回答1:

Suppose you have an input field with name 'name' and type 'text', you can call

WebBrowser1.OleObject.Document.GetElementByID('name').setAttribute('value', 'somename');