I'm just curious on this one. An application I inherited at the new job is a big ( read: almost umwieldy ) piece of code with a web interface for creating "large database-driven forms" because, according to the owner of the (small) company, "programmers hate developing forms."
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:
[% mycgi.popup_menu(
'-name'=>'areaIDs',
'-values' => AREAS.keys.nsort,
'-labels' => AREAS,
'-default' => THIS_PAGE.area_id,
'-multiple' => '1',
'-size' => '5' ) %]
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 ).
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?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.