Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Controlling TWebBrowser Page controls ?

Posted on 2008-10-03
2
Medium Priority
?
294 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 1000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

670 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