Maybe I've been spoiled a bit my taking advantage of Template::Toolkit's integration with CGI.pm, but I've never had an issue creating forms. A few database queries to get the defualt (already in the DB) values for a given form, to get the popup_menu() options, and pass it all into TT. Let CGI.pm handle the HTML for the form elements, like:
And I'm done with a form element. If I need a handful of them, I still only have one line of code in the form to generate another element ( and maybe another query to get the info for that particular form element ).[% mycgi.popup_menu( '-name'=>'areaIDs', '-values' => AREAS.keys.nsort, '-labels' => AREAS, '-default' => THIS_PAGE.area_id, '-multiple' => '1', '-size' => '5' ) %]
So, am I just going about things "the long way?" Is there some real benefit to a custom-rolled, DB-driven form generator that's only used for DB-based forms?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "roll your own" form generator
by CountZero (Bishop) on Jan 11, 2004 at 19:45 UTC | |
by geektron (Curate) on Jan 11, 2004 at 19:58 UTC | |
by CountZero (Bishop) on Jan 11, 2004 at 20:31 UTC | |
by geektron (Curate) on Jan 11, 2004 at 20:34 UTC | |
by CountZero (Bishop) on Jan 11, 2004 at 20:19 UTC | |
|
Re: "roll your own" form generator
by kutsu (Priest) on Jan 11, 2004 at 20:01 UTC |