My issue is this: How do I invoke in my template a "<tmpl-var field-checkbox>" with a variable fieldname, which changes on each iteration through the loop and have my dynamically generated checkbox embedded in rows of my output?'fieldrefs' => { 'group_action_94' => bless( { 'cleanopts' => 1, 'fieldrefs' => {}, 'options' => [ 'perform_group_action' ], 'value' => 'perform_group_action', 'name' => 'group_action_94', 'selectname' => 1, 'sticky' => 0, 'required' => 0, '_form' => ${$VAR1}, 'type' => 'checkbox', 'label' => '', 'selectnum' => 5, 'validate' => undef }, 'CGI::FormBuilder::Field' ),
Do I need to extend HTML::Template to add a new tag to accommodate a variable field name? And if so, can anyone with knowledge of its innards offer guidance about how best to accomplish that? And if not, how would this be done?
FYI: Save the fact that perlmonks does not want to seem to want me to embed a form into this node, this is the result I'm hoping to see:
<form action="dashboard.cgi" id="Group_Actions" method="post" name="Group_Actions">
|
Call Group: <select id="group" name="group"> <option value="">-select-</option> <option value="7">test_group_001</option> <option value="14">test_group_007</option> <option value="15">test_group_008</option> </select> Group Action: <select id="group_action" name="group_action"> <option value="">-select-</option> <option value="edit_group">Edit Group</option> <option value="add_to_group">Add to Group</option> <option value="remove_from_group">Remove from Group</option> <option value="delete_from_list">Delete from List</option> </select> |
<input id="Group_Actions_submit" name="_submit" type="submit" value="Process Group Action" /> | ||||
| Tag | First Name | Last Name | Phone | Actions | |
|---|---|---|---|---|---|
| <input type="checkbox" name="group_action_94" value="perform_group_action"> | Testy | Tester | tt@example.com | 123-555-1212 | some links |
| <input type="checkbox" name="group_action_95" value="perform_group_action"> | Testoria | Tester | tt2@example.com | 321-555-1212 | some links |
Please note: that the field name changes for each checkbox in the tag column; and that the number of rows in this table can not be predicted and will change with user input.
-- Hugh Esco
In reply to Re: CGI::FormBuilder, HTML::Template and \@loop_data question; trying again
by hesco
in thread CGI::FormBuilder, HTML::Template and \@loop_data question; trying again
by hesco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |