The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Win32::IE::Form - Mimic HTML::Form

SYNOPSIS

    use Win32::OLE;
    use Win32::IE::Form;

    my $agent = Win32::OLE->new( 'InternetExplorer.Application' );
    $agent->Navigate( $uri );

    # extract the images and wrap them as Win32::IE::Image
    my $doc = $agent->Document;
    my @forms;
    for ( my $i=0; $i < $doc->forms->lenght; $i++ ) {
        push @forms, Win32::IE::Form->new( $doc->forms( $i ) );
    }

    # print the information from the forms:
    foreach my $form ( @forms ) {
        printf "%s as %s\n", $form->action, $img->name||"";
    }

DESCRIPTION

The Win32::IE::Form object is a thin wrapper around the DOM-object supplied by the InternetExplorer.Application. It is implemented as a blessed reference to the Win32::OLE-DOM object.

METHODS

Win32::IE::Form->new( $form_obj );

Initialize a new object, it is only a ref to a scalar, the rest is done through the methods.

$form->method( [$new_method] )

Get/Set the method used to submit the from (i.e. GET or POST).

$form->action( [$new_action] )

Get/Set the action for submitting the form.

$form->enctype( [$new_enctype] )

Get/Set the enctype of the form.

$form->attr( $name[, $new_value] )

Get/Set any of the attributes from the FORM-tag.

$form->name()

Return the name of this form.

$form->inputs()

Returns a list of Win32::IE::Input objects. In scalar context it will return the number of inputs.

$form->find_input( $name[, $type[, $index]] )

This method is used to locate specific inputs within the form. All inputs that match the arguments given are returned. In scalar context only the first is returned, or undef if none match.

If $name is specified, then the input must have the indicated name.

If $type is specified, then the input must have the specified type. The following type names are used: "text", "password", "hidden", "textarea", "file", "image", "submit", "radio", "checkbox" and "option".

The $index is the sequence number of the input matched where 1 is the first. If combined with $name and/or $type then it select the nth input with the given name and/or type.

(This method is ported from HTML::Form)

$form->value( $name[, $new_value] )

Get/Set the value for the input-contol with specified name.

$form->submit()

Submit this form.

$self->_radio_group( $name )

Returns a list of Win32::OLE objects with <input type="radio" name="$name">.

COPYRIGHT AND LICENSE

Copyright MMIV, Abe Timmerman <abeltje@cpan.org>. All rights reserved

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.