On 25/03/2008, vti <[EMAIL PROTECTED]> 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
_______________________________________________
HTML-FormFu mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu