Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    HTML::FormEngine 1.01

    Download button

    No screenshots available
    Downloads: 435  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.7/5)
    4 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Moritz Sinn | More programs
    Perl Artistic License / FREE
    December 13th, 2007, 21:02 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    HTML::FormEngine description

    A Perl module to create, validate and control HTML/XHTML forms

    HTML::FormEngine is a Perl module to create, validate and control HTML/XHTML forms.

    Example Code

    #!/usr/bin/perl -w

    use strict;
    use CGI;
    use HTML::FormEngine;
    #use POSIX; # for setlocale
    #setlocale(LC_MESSAGES, 'german'); # for german error messages

    my $q = new CGI;
    print $q->header;

    my $Form = HTML::FormEngine->new(scalar $q->Vars);
    my @form = (
    {
    templ => 'select',
    NAME => 'Salutation',
    OPTION => [[['mr.','mrs.']]],
    },
    {
    templ => 'hidden_no_title',
    NAME => 'test123',
    VALUE => 'test',
    },
    {
    SIZE => 10,
    MAXLEN => 20,
    PREFIX => [[' ', ' / ']],
    NAME => 'name',
    TITLE => 'For- / Surname ',
    ERROR_IN => 'not_null'
    },
    {
    MAXLEN => 30,
    NAME => 'Email',
    ERROR => ['not_null', ['rfc822'], ['match', 'matched net!']] # rfc822 defines the email address standard
    },
    {
    templ => 'radio',
    TITLE => 'Subscribe to newsletter?',
    NAME => 'newsletter',
    OPT_VAL => [[1, 2, 3]],
    OPTION => [['Yes', 'No', 'Perhaps']],
    VALUE => 1
    },
    {
    templ => 'check',
    OPTION => 'I agree to the terms of condition!',
    NAME => "agree",
    TITLE => '',
    ERROR => sub{ return("you've to agree!") if(! shift); }
    }
    );

    $Form->set_seperate(1);
    $Form->conf(@form);
    $Form->make();

    print $q->start_html('FormEngine example: Registration');
    if($Form->ok){
    $Form->clear();
    print "

    You've successfully subscribed!

    ";
    }
    print $Form->get,
    $q->end_html;


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    create XHTML forms | create HTML forms | Perl module | HTML | XHTML | forms

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM