Data::HTML::Form - Data object for HTML form.
use Data::HTML::Form; my $obj = Data::HTML::Form->new(%params); my $action = $obj->action; my $css_class = $obj->css_class; my $enctype = $obj->enctype; my $id = $obj->id; my $label = $obj->label; my $method = $obj->method;
new
my $obj = Data::HTML::Form->new(%params);
Constructor.
Returns instance of object.
action
Form action.
Default value is undef.
css_class
Form CSS class.
enctype
Form enctype, attribute which specifies how the form-data should be encoded when submitting it to the server.
Possible values are:
(undefined - same as application/x-www-form-urlencoded)
application/x-www-form-urlencoded
multipart/form-data
text/plain
id
Form identifier.
label
Form label.
method
Form method.
Default value is 'get'.
Possible methods are: get and post
my $action = $obj->action;
Get form action.
Returns string.
my $css_class = $obj->css_class;
Get CSS class for form.
my $enctype = $obj->enctype;
Get enctype, attribute which specifies how the form-data should be encoded when submitting it to the server.
Get form identifier.
Get form label.
Get form method.
new(): Parameter 'enctype' has bad value. Value: %s Parameter 'method' has bad value. Value: %s
use strict; use warnings; use Data::HTML::Form; my $obj = Data::HTML::Form->new; # Print out. print 'Method: '.$obj->method."\n"; # Output: # Method: get
use strict; use warnings; use Data::HTML::Form; my $obj = Data::HTML::Form->new( 'action' => '/action.pl', 'css_class' => 'form', 'enctype' => 'multipart/form-data', 'id' => 'form-id', 'label' => 'Form label', 'method' => 'post', ); # Print out. print 'Action: '.$obj->action."\n"; print 'CSS class: '.$obj->css_class."\n"; print 'Enctype: '.$obj->enctype."\n"; print 'Id: '.$obj->id."\n"; print 'Label: '.$obj->label."\n"; print 'Method: '.$obj->method."\n"; # Output: # Action: /action.pl # CSS class: form # Enctype: multipart/form-data # Id: form-id # Label: Form label # Method: post
Error::Pure, List::Util, Mo, Readonly.
https://github.com/michal-josef-spacek/Data-HTML-Form
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2022 Michal Josef Špaček
BSD 2-Clause License
0.06
To install Data::HTML::Form, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::HTML::Form
CPAN shell
perl -MCPAN -e shell install Data::HTML::Form
For more information on module installation, please visit the detailed CPAN module installation guide.