With HTML::Template, you can ask a friend or a proffesional to design the HTML part for you, and then simply fill in the missing values from Perl.
The template would look somewhat like this:
The Perl code is fairly simple: to set a TMPL_VAR you assign a value to it with $template->param(name=>value). To assign all the values to the rows of a TMPL_LOOP, you assign it a reference to an array of hashes, where each hash represents one row of the table, and the hashes contain the (variable name, variable value) pairs.<table> <tr><th>Remove</th><th>Artist</th>.....</tr> <TMPL_LOOP name="cd_table"> <tr> <td><input type="checkbox" name="delete<TMPL_VAR name="__counter__"> +"</td> <td><TMPL_VAR name="artist"></td> <td><TMPL_VAR name="album"></td> <td><TMPL_VAR type=select name="combo1_<TMPL_VAR name="__counter__"> +">......</td> ..... # you get the idea </TMPL_LOOP> </table>
Note the __counter__ references above: they are meant to give each checkbox and each combobox a name associated with the row number in which it appears: that is the only way to know which checkbox or combobox the user has selected. Hope this helps...
In reply to Re: Re: Re: Form with Table - FormBuilder, map, or template?
by matija
in thread Form with Table - FormBuilder, map, or template?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |