Solved

Controlling TWebBrowser Page controls ?

Posted on 2008-10-03
2
290 Views
Last Modified: 2012-05-05
In code, how can I traverse a TWebBrowser's page and find a list control by its ID (LogBookPanel1_ddLogType) and select a item from the list?

thanks

 <select name="LogBookPanel1$ddLogType" id="LogBookPanel1_ddLogType">
<option selected="selected" value="-1">- Select One -</option>
<option value="13">Retrieve from WCMC</option>
<option value="19">Grab it from somewhere else</option>
<option value="4">Write note</option>
<option value="48">Discovered it</option>
<option value="-1">- Select One -</option>
</select>
0
Comment
Question by:geocoins-software
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 21

Expert Comment

by:ziolko
ID: 22637892
not exactly what you looking for but there are code snippets how to access elements of web-page:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_21372503.html
especially first comment by calinutz can be helpfull

ziolko.
0
 
LVL 5

Accepted Solution

by:
wd123 earned 250 total points
ID: 22663457
as you wish =)
const html='<html><body><select name="LogBookPanel1$ddLogType" id="LogBookPanel1_ddLogType">'+
'<option selected="selected" value="-1">- Select One -</option>'+
'<option value="13">Retrieve from WCMC</option>'+
'<option value="19">Grab it from somewhere else</option>'+
'<option value="4">Write note</option>'+
'<option value="48">Discovered it</option>'+
'<option value="-1">- Select One -</option>'+
'</select></body></html>';
var el:OleVariant;
begin
WebBrowser1.Navigate('about:blank');
while WebBrowser1.ReadyState<>4 do begin Application.ProcessMessages;sleep(50);end; //wait
WebBrowser1.OleObject.document.write(html);//simulate page
el:=WebBrowser1.OleObject.document.getElementById('LogBookPanel1_ddLogType');
el.value:=4;//select 'Write note'

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

632 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