HTML::FormWizard

Forms HTML made simple
Download

HTML::FormWizard Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Marco Neves
  • Publisher web site:
  • http://search.cpan.org/~neves/

HTML::FormWizard Tags


HTML::FormWizard Description

Forms HTML made simple HTML::FormWizard is a Perl module that uses CGI to retrieve data from the requests, and the HTML forms are produced using an object template that if not provided, will be $self (a self reference).There are to much libs that write forms, and only a few that process both things, that is, write HTML forms, and retrieve the data send by the user.Or... in a more correct way... That handles everything between the first request and the correct data introduction. Why should every program we devel ask some module to create a form, and then ask some other to verify that the submit is correct? Or why should it verify the data?HTML::FormWizard was wrote for that.HTML::FormWizard is a Perl module that uses CGI to retrieve data from the requests, and the HTML forms are produced using an object template that if not provided, will be $self (a self reference).SYNOPSIS # this script does almost the same that CGI.pm # example. And, yes, I use CGI, that is, # writes a form and write the submited values use CGI(); use HTML::FormWizard(); my $form = HTML::FormWizard->new( -title => 'A simple Example', -fields => , defaults => }, { name => 'color', description => "What's your favorite color?", type => 'list', value => } ] ); # Well, That almost it... But now, that do other things... # Append field another list field, this one with # descriptions, for example... that you must select, # initially saying "--Select Please--". $form->add( { name => 'country', description => 'Where did you born?', type => 'list', value => { pt => 'Portugal', us => 'United States', uk => 'United Kingdom', fr => 'France', '--' => 'Other', '' => '--Select Please--'}, default => '', needed => 1 } ); # And just one more... A password field, that must # have 3 to 8 characters length, and you want to # validate with a function you wrote... $form->add( { name => 'password', type => 'password', minlen => 3, maxlen => 8, validate => sub { my $pass = shift; return 0 if (($pass =~ /d/) and ($pass =~ //) and ($pass =~ /W/)); return "The field password must have at least a number,". " a letter and a symbol"; }, needed => 1 } ); # And now... let's get the results!!! if (my $data=$form->run) { print qq( Your name id $$data{name} The Keywords are: ), join(", ", @{$$data{words}}),qq( Your Favorite Color is $$data{color} Your birth country is $$data{country} And you password is $$data{password} ) } Requirements: · Perl


HTML::FormWizard Related Software