GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
HTML::FieldForm(3) User Contributed Perl Documentation HTML::FieldForm(3)

FieldForm -- Handle HTML forms with Field objects

   use HTML::FieldForm;
   use HTML::Field;
   
   # Object constructor
   my $form = HTML::FieldForm->new(    
     part_number      => [ 'Textfield', {
                            primary_key => 1,
                       } ],
     description      => [ 'Textarea', {
                            cols        => 60,
                            rows        => 6,
                       } ],
     purchasing_code =>  [ 'Select', {
                            options     => \@purchasing_codes,
                            labels      => \%purch_codes_labels,
                       } ],
   );
   
   # The returned object is a hash of HTML::Field objects keyed by name:
   my $part_number = $form->{part_number};
   
   # Set the value of the fields from a hash ref
   my %values = (part_number => '16-0021', description => 'Brushplate');
   $form->set_values(\%values);

   # Set the value of the fields from a CGI object
   my $query = new CGI;
   $form->set_values($query);

   # Get the values of all the fields in a hash
   my %data = $form->get_values;
 
   # Reset all the field values to their defaults
   $form->reset_values;
   
   # Get a hash with editable or read only html (fieldname => html)
   # Specially useful for HTML::Template
   my %editable = $form->editable_html;
   my %readonly = $form->readonly_html;
   my %creation = $form->creation_html;
   
   # Request XHTML instead of HTML
   $field_form->set_xhtml(1); # Gets xhtml
   $field_form->set_xhtml(0); # Gets html (default)
   
   # Request the addition of an ID selector for each form field 
   # (same as its name)
   $field_form->add_id;
   
   # These two last methods return the HTML::FieldForm object, so that
   # you can say:
   %editable = $field_form->xhtml(1)->add_id->editable_html;

The goal of this simple module is to perform common actions over a set of HTML form fields in order to get rid of some of the tedious of scripting CGI.

Julio Fraire, <jfraire@gmail.com<gt>

Copyright (C) 2006 by Julio Fraire

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.

2009-11-26 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.