nodata has asked for the wisdom of the Perl Monks concerning the following question:
I've got an online form!
To avoid code and HTML mixage, I'm trying desperately to keep everything separate: the HTML is read from a file on disk, mixed around, then displayed to the user after some Perl magic.
I plan to use HTML::Defaultify to choose sensible defaults in the form.
I plan to use HTML::FillInForm to keep the form sticky.
Everything looks good so far - but how can I initially populate the form with values (based on the person using the form)?
Ideally I'd like to do something like:
my $html = &get_html(); my $pop = new Form::Populator; if (! $cgi->param('validate') ) { my $new_html = $pop->populate( computers => qw/ abra cada bra /, staff => qw/ alice bob chris / ) } # $html now contains a nice bit of HTML that has had # values added to the list boxes with name "computers" # and "staff".
I'd really rather avoid a full blown template solution like the Template Toolkit.
Any ideas? THANKS!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Populating forms
by Corion (Patriarch) on Mar 29, 2004 at 09:16 UTC | |
by nodata (Initiate) on Mar 29, 2004 at 09:33 UTC | |
by clscott (Friar) on Mar 29, 2004 at 18:20 UTC | |
|
Re: Populating forms
by Happy-the-monk (Canon) on Mar 29, 2004 at 09:05 UTC | |
by nodata (Initiate) on Mar 29, 2004 at 09:21 UTC | |
by Happy-the-monk (Canon) on Mar 29, 2004 at 09:29 UTC |