[html-formfu] Form values from TT ?

J. Bobby Lopez bobby.lopez at gmail.com
Fri Oct 28 17:17:55 GMT 2011


I'm looking for way to use data from TT as the value for a hidden form element.

Here's an example that may clarify:

<code>
  <!---- Access Table ---->

    [% IF access_results %]
          <div name="accesstable">
           <table id="access-table" class="admin-edit-table">
           <thead name="sa-access-tab-head">
            <tr>
            <th> Edit </th>
           [% FOREACH field IN access_fields %]
            <th>[% field %]</th>
           [% END %]
            </tr>
           </thead>
           [% FOREACH r IN data_access_table %]
            <tr class="admin-edit-table">
                <td nowrap style="text-align:center">
                    <form name="admin-edit-table" method="post">
                    <input type="submit"
                     name="admin_edit" value="Edit">
                    <input type="hidden" name="admin_edit_record"
value="[% r.0 %]">
                    </form>
                </td>
                [% FOREACH c IN r %]
                 <td nowrap>[% c %]</td>
                [% END %]
            </tr>
           [% END %]
           </table>
          </div>
    [% END %]
</code>


For each row above, I'm generating a full HTML form to serve as the
submit button which populates the hidden form element with a value
passed to Template Toolkit.

I need this same edit button for each row, and need the hidden value
to contain the row ID.  I'm not sure how to accomplish this using
straight FormFu, without using multiple FormFu objects, which I'd like
to avoid.

I could be coming at this from the wrong angle, so any suggestions are
appreciated.

Thanks,
-Bobby



More information about the HTML-FormFu mailing list