|
NAMEHTML::DOM::Element::Form - A Perl class for representing 'form' elements in an HTML DOM tree VERSIONVersion 0.058 SYNOPSIS use HTML::DOM;
$doc = HTML::DOM->new;
$elem = $doc->createElement('form');
$elem->method('GET') # set attribute
$elem->method; # get attribute
$elem->enctype;
$elem->tagName;
# etc
DESCRIPTIONThis class implements 'form' elements in an HTML::DOM tree. It implements the HTMLFormElement DOM interface and inherits from HTML::DOM::Element (q.v.). A form object can be used as a hash or an array, to access its input fields, so "$form->[0]" and "$form->{name}" are shorthand for "$form->elements->[0]" and "$form->elements->{name}", respectively. This class also tries to mimic HTML::Form, but is not entirely compatible with its interface. See "WWW::Mechanize COMPATIBILITY", below. DOM METHODSIn addition to those inherited from HTML::DOM::Element and HTML::DOM::Node, this class implements the following DOM methods:
WWW::Mechanize COMPATIBILITYIn order to work with WWW::Mechanize, this module mimics, and is partly compatible with the interface of, HTML::Form. HTML::Form's class methods do not apply. If you call "HTML::DOM::Element::Form->parse", for instance, you'll just get an error, because it doesn't exist. The "dump" and "try_others" methods do not exist either. The "click" method behaves differently from HTML::Form's, in that it does not call "make_request", but triggers a 'click' event if there is a button to click, or a 'submit' event otherwise. The "method", "action", "enctype", "attr", "inputs", "find_input", "value", "param", "make_request" and "form" methods should work as expected. SEE ALSOHTML::DOM HTML::DOM::Element HTML::DOM::Collection::Elements HTML::Form
|