I have an application which presents a web form to the user which provides for a variable number fieldsets full of the same fields over and over. I'm using CGI::FormBuilder to render the form, and so far that seems to be working just fine. Now I'm trying to introduce an HTML::Template into the mix.
The CGI::FormBuilder perldoc suggests using something like this:
<p>Your email address: <tmpl_var field-email>
in the html.tmpl file. But I need something more like:
<fieldset class="fb_set" id="person0798">
<p>Your email address: <tmpl_var field-person0798_email>
</fieldset>
<fieldset class="fb_set" id="person8635">
<p>Your email address: <tmpl_var field-person8635_email>
</fieldset>
<fieldset class="fb_set" id="person3248">
<p>Your email address: <tmpl_var field-person3248_email>
</fieldset>
With the person#### codes being used to interact with the database on the processing side of things. And a bunch of other fields included in each fieldset.
I see no example in the CGI::FormBuilder perldoc of use'ing HTML::Template. Nor of instantiating a $template object, which I'm assuming may all be handled inside the CGI::FormBuilder module, but that is just a guess. I certainly see nothing of the $template->methods which permit passing data to the template. Am I limited only to pass field definitions? And if so, how do I account for these fieldsets of uniquely identified sets of fields?
Am I missing something here?
Confused on how to proceed,
-- Hugh
if( $lal && $lol ) { $life++; }
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.