Thread

Posted on Wed Nov 23 14:34:48 2005 by jstenzel
How to read all options of a select control?
Hello,

is it possible to make W32::IE::M objects provide a list of all options in a certain select control?

I'm refilling select controls with new options by Javascript handlers and want to check if this operation succeeds.

Thanks in advance

Jochen Stenzel
Direct Responses: 1405 | Write a response
Posted on Fri Nov 25 13:01:51 2005 by abeltje in response to 1389
Re: How to read all options of a select control?
Hi Jochen,

This is not possible through the WIM interface, but you can try the IE automation API (untested):

my $select = $ie->current_form->find_input( 'selectname', 'select' ) or die "'selectname' not found +"; my $sel_ole = $$select; # Get the OLE object for ( my $i = 0; $i < $sel_ole->options->length; $i++ ) { printf "option value = '%s'\n", $sel_ole->options( $i )->value; }
See also: http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/select.asp
Mind you, this is *undocumented* behaviour, and access to the OLE objects will change in future!

HTH,
-- Abe.
Write a response