CGI::QuickForm

Perl module to provide quick CGI forms
Download

CGI::QuickForm Ranking & Summary

Advertisement

  • Rating:
  • License:
  • LGPL
  • Price:
  • FREE
  • Publisher Name:
  • Mark Summerfield
  • Publisher web site:
  • http://search.cpan.org/~summer/

CGI::QuickForm Tags


CGI::QuickForm Description

Perl module to provide quick CGI forms CGI::QuickForm is a Perl module that provides a quick and simple mechanism for providing on-line CGI forms.When show_form executes it presents the form with the fields requested. As you can see from the minimal example at the beginning of the synopsis it will default everything it possibly can to get you up and running as quickly as possible.If you have specified any validation it will validate when the user presses the submit button. If there is an error it will re-present the form with the erroneous fields marked and with all the data entered in tact. This is repeated as often as needed. Once the user has corrected all errors and the data is valid then your &on_valid_form subroutine will be called so that you can process the valid data in any way you wish.Note that EXAMPLE #1 and EXAMPLE #2 are in this pod; example1, example2, etc. are supplied as files.SYNOPSIS # Minimal example. (Insecure no error checking.) #!/usr/bin/perl -w use strict ; use CGI qw( :standard :html3 ) ; use CGI::QuickForm ; show_form( -ACCEPT => &on_valid_form, # You must supply this subroutine. -TITLE => 'Test Form', -FIELDS => , ) ; sub on_valid_form { my $name = param( 'Name' ) ; my $age = param( 'Age' ) ; open PEOPLE, ">>people.tab" ; print PEOPLE "$name $age " ; close PEOPLE ; print header, start_html( 'Test Form Acceptance' ), h3( 'Test Form Data Accepted' ), p( "Thank you $name for your data." ), end_html ; } # All QuickForm options (aide memoir) #!/usr/bin/perl -w use strict ; use CGI qw( :standard :html3 ) ; use CGI::QuickForm ; show_form( -ACCEPT => &on_valid_form, -BORDER => 0, -FOOTER => undef, -HEADER => undef, -INTRO => undef, -LANGUAGE => 'en', -USER_REQUIRED => undef, -USER_INVALID => undef, -TITLE => 'Test Form', -REQUIRED_HTML => '+', -INVALID_HTML => '*', -VALIDATE => undef, # Set this to validate the entire record -SIZE => undef, -MAXLENGTH => undef, -ROWS => undef, -COLUMNS => undef, -CHECK => 1, -SPACE => 0, # Output some newlines to assist debugging if 1 -MULTI_COLUMN => 0, -NAME => undef, -ONSUBMIT => undef, -JSCRIPT => {}, -STYLE_FIELDNAME => '', -STYLE_FIELDVALUE => '', -STYLE_BUTTONS => '', -STYLE_ROW => '', -STYLE_WHY => '', -TABLE_OPTIONS => '', -FIELDS => , -size => 1, -multiples => undef, }, { -LABEL => 'Worst Sport', -TYPE => 'radio_group', -values => , -default => 'Golf', }, # Any other CGI.pm field can be used in the same way. ], -BUTTONS => , ) ; Requirements: · Perl


CGI::QuickForm Related Software