[html-formfu] Date element stopped working
vti
viacheslav.t at gmail.com
Tue Mar 25 12:38:27 GMT 2008
Carl Franks(fireartist at gmail.com)@Tue, Mar 25, 2008 at 11:20:34AM +0000:
> 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
I created sample Cat app and behaves the same as my app. Sorry for the name, but
it is what I fill now :)
--
vti -- Viacheslav Tikhanovskii
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WTF.tar.gz
Type: application/octet-stream
Size: 41758 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20080325/a09fd105/WTF.tar-0001.obj
More information about the HTML-FormFu
mailing list