[html-formfu] Date element stopped working

Carl Franks fireartist at gmail.com
Tue Mar 25 11:20:34 GMT 2008


On 25/03/2008, vti <viacheslav.t at gmail.com> wrote:
>
>  I must admit that `default_natural: 'today'' works and adding to the db through
>  DBIC model works too, but getting it out and filling the form doesn't.
>  Everything except Date element works in the both directions. I am using MySQL,
>  my conf looks like:
>
>  ---
>  attributes:
>   class: formfu
>  elements:
>   - type: Text
>     name: title
>     label_loc: 'formx_label_title'
>     constraints:
>       - type: Required
>         message_loc: 'formx_constraint_required'
>
>   - type: Date
>     name: endtime
>     strftime: '%Y-%m-%d'
>
>   - type: Submit
>     name: submit
>     value_loc: 'formx_value_submit_save'
>
>  constraints:
>   - SingleValue
>
>  When I try something like:
>
>     $form->get_element('title')->default('foo');
>     $form->get_element('endtime')->default('2008-05-06');
>
>  Title is filled with the `foo' value and date doesn't :-(

Your config looks ok, so I think the problem must be in your code.

Remember that if the form's been submitted (or anything else is
causing submitted() to return true) - then setting default() won't
work.
Could that be the problem?

If not, can you post your code, so I can see how you're using the form?

Carl



More information about the HTML-FormFu mailing list