[Catalyst] HTML::Widget and TT - how to access data

Roman Filippov moltar at spamcop.net
Sun Feb 12 02:02:43 CET 2006


I am playing around with HTML::Widget. It looks nice and generates clean
XML code - very nice. Sometimes the forms get way too complex for the
artificial intelligence and need customization.

I want to be able to get data from the HTML::Widget object. I know it
consists of HTML::Element objects mostly. For example, if I want to get
the <select> data, I found one way to do this:

<select name="field">
[% FOREACH elem = form.element('field').element.content_list %]
<option value="[% elem.value %]"[% IF elem.selected %]
selected="selected"[% END %]>[% elem.content.0 %]</option>
[% END %]
</select>


This looks pretty long and ugly. Is there an easier way to access the
data? Like inputed values, selects, radio buttons?




More information about the Catalyst mailing list