Hi,
I'm passing an array of hashes into a template, and it displays fine. I'd like to pass the hash back to the script again, but am having problems.
Below the data is passed and displayed ok, but when I submit the form, the [% element %] is passed pack to my script as a scalar , with an example value of "HASH(0x10a88f4)"
Am I able to pass back the hash ion the simplistic way ?
The reason for this, is that there are approx 50 fields inside the hash, and I'd like the user to be able to edit 2 of them , before submitting this data to a database.
Regards
Martin
script
my %r = ( elem1 => 'one,
elem2 => 'two',
...
);
push(@elem_data,\%r);
Template
<form ...>
[% FOREACH element IN elem_data %]
<tr><td>[% element.elem1 %]</td>
<td>[% element.elem2 %]</td>
<td><input name="elem_data" value="[% element %]"></td>
</tr>
[% END %]
</form>
- [Templates] passing a hash back inside a form Martin Bower
