Friday, May 29, 2009

Setting a date-Field to default values

Hi,

I´m having a problem to set the values of a date-field.

A little example:

The table "users":
id, int(11), auto_increment, primary key
today, date

I know that this example doesn´t make sense, but it´s only a example.

My Controller:
...
$this->set('user', $this->user->read(null, $id)
...

And the view:
...
echo $form->input('User.today', array('dateFormat' => 'DMY'));
...

cake creates a field existing out of
a day
a month
and a year field
(forgive me for my bad english - I do my best)

How set this field to, lets say 1.2.2003

This doesn#t work:

echo $form->input('User.today', array('dateFormat' => 'DMY',
'selected' => '01-02-2003'));
or
echo $form->input('User.today', array('dateFormat' => 'DMY',
'selected' => '2003-02-01'));

Please help!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: