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!
In reply to Populating forms by nodata
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |