HTML::FormTemplate

HTML::FormTemplate can make data-defined persistant forms, reports.
Download

HTML::FormTemplate Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Darren R. Duncan
  • Publisher web site:
  • http://search.cpan.org/~duncand/CGI-Portable-0.51/lib/CGI/Portable/AppMultiScreen.pm

HTML::FormTemplate Tags


HTML::FormTemplate Description

HTML::FormTemplate can make data-defined persistant forms, reports. HTML::FormTemplate can make data-defined persistant forms, reports.SYNOPSIS #!/usr/bin/perl use strict; use warnings; use HTML::FormTemplate; use HTML::EasyTags; my @definitions = ( { visible_title => "What's your name?", type => 'textfield', name => 'name', is_required => 1, }, { visible_title => "What's the combination?", type => 'checkbox_group', name => 'words', 'values' => , default => , }, { visible_title => "What's your favorite colour?", type => 'popup_menu', name => 'color', 'values' => , }, { type => 'submit', }, ); my $query_string = ''; read( STDIN, $query_string, $ENV{'CONTENT_LENGTH'} ); chomp( $query_string ); my $form = HTML::FormTemplate->new(); $form->form_submit_url( 'http://'.($ENV{'HTTP_HOST'} || '127.0.0.1').$ENV{'SCRIPT_NAME'} ); $form->field_definitions( @definitions ); $form->user_input( $query_string ); my ($mail_worked, $mail_failed); unless( $form->new_form() ) { if( open( MAIL, "|/usr/lib/sendmail -t") ) { print MAIL "To: perl@DarrenDuncan.netn"; print MAIL "From: perl@DarrenDuncan.netn"; print MAIL "Subject: A Simple Example HTML::FormTemplate Submissionn"; print MAIL "n"; print MAIL $form->make_text_input_echo()."n"; close ( MAIL ); $mail_worked = 1; } else { $mail_failed = 1; } } my $tagmaker = HTML::EasyTags->new(); print "Status: 200 OKn", "Content-type: text/htmlnn", $tagmaker->start_html( 'A Simple Example' ), $tagmaker->h1( 'A Simple Example' ), $form->make_html_input_form( 1 ), $tagmaker->hr, $form->new_form() ? '' : $form->make_html_input_echo( 1 ), $mail_worked ? "< p >Your favorites were emailed.< /p >n" : '', $mail_failed ? "< p >Error emailing your favorites.< /p >n" : '', $tagmaker->end_html; Requirements: · Perl


HTML::FormTemplate Related Software