[html-formfu] Disabled form field with retain_default and render_processed_value

Carl Franks fireartist at gmail.com
Wed May 7 15:58:12 BST 2008


2008/4/18 Kiki <kiki at bsdro.org>:
> Hello all,
>
>  I have a form with a field filled in with a timestamp (via DateTime
> inflator) from a DB.
>  The default stringification of the DateTime object is kinda ugly
> (2008-04-18T17:10:06)
>  so I have set up a strftime deflator for the field to format it properly.
>
>  This field is disabled therefore when the user submits the form, the field
> value is not sent to the server.
>  After submission I re-display the form, but since the field was not sent
> the field is empty.
>  I have set "retain_default" for the field and upon submission the field is
> displayed with the proper value from the DB.
>
>  The problem is that the second time (after submission) the deflation phase
> is skipped thus the ugly DateTime stringified
>  value is displayed. Setting "render_processed_value" has no effect
> (probably because the field does not appear in the request sent to the
> server).
>
>  Is there another way to accomplish displaying a formatted value fetched
> from the database or am I overlooking something?

Hi Kiki,

I've fixed this now, so it should work as you expect - it's available
in svn revision 1009, and will be included in the next cpan release.

You can check the test files to compare the config I used:
    t/bugs/render_processed_value_retain_default.t
    t/bugs/render_processed_value_retain_default.yml

Cheers,
Carl



More information about the HTML-FormFu mailing list