[Catalyst] Data::FormValidator

Hartmaier Alexander Alexander.Hartmaier at t-systems.at
Thu Nov 24 14:23:24 CET 2005


$field is the name of the form field.
I do a lookup in my 'field_names' hash to format the field names nicely.
You can access c->form->msgs directly, putting it in the stash is just because 
i want every var i display to be there. Just coding style, should work your 
way too.

In my profile i have defined

msgs => {
      format      => '%s',
      },

so that FormValidator doesn't use it's own formating for the error messages.

-Alex


-----Original Message-----
From: catalyst-bounces at lists.rawmode.org 
[mailto:catalyst-bounces at lists.rawmode.org] On Behalf Of Caroline Johnston
Sent: Thursday, November 24, 2005 1:15 PM
To: The elegant MVC web framework
Subject: RE: [Catalyst] Data::FormValidator

>   [% FOREACH field IN errors.keys %]
...
>     <td>[% errors.$field %]</td>

OK - so what is in errors.$field? I'm doing:

 [% FOREACH msg IN c.form.msgs %]
 <b class="warning">[% msg.key %]:</b> [% msg.value %]  <br/>
 [% END %]

Which I think is more or less equivalent (?) and the contents of [%
msg.value %] is something like:

<span style="color:red;font-weight:bold"><span class="dfv_errors">*
missing</span></span>

Is that what you get? If not, what's the diff between [% msg.value %] and
[% errors.$field %]?

Cxx.


_______________________________________________
Catalyst mailing list
Catalyst at lists.rawmode.org
http://lists.rawmode.org/mailman/listinfo/catalyst
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5544 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20051124/387bd999/smime.bin


More information about the Catalyst mailing list