in reply to Is this attempt at a generic form using CGI really silly/inefficient/useless waste of time?
Have you looked at CGI::FormBuilder?
#!/usr/bin/perl -wT use CGI::FormBuilder; # Fields to create/label/read my @fields = qw/name email password confirm_password zipcode/; # Required fields (labels will be shown in bold) my @req = @fields[0..3]; # Do it! my $form = CGI::FormBuilder->new(method => 'post', fields => \@fields, + required => \@req); # Validate via JavaScript, etc.; process if ($form->submitted) { my $field = $form->fields; # update_db($field->fields}; # This is where you'd update the dat +abase, etc. print $form->confirm(header => 1); } else { print $form->render(header => 1); }
-- Human history becomes more and more a race between education and catastrophe. -- HG Wells
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is this attempt at a generic form using CGI really silly/inefficient/useless waste of time?
by LesleyB (Friar) on Jul 12, 2008 at 02:15 UTC | |
by LesleyB (Friar) on Jul 12, 2008 at 02:25 UTC |