ok, i mistakenly used DATE type instead of DATETIME. now the pre-
selected value is displayed.
i also discover that, to show the empty option (but not pre-selected),
the corrent parameter is "empty" and not "showEmpty"...
echo $form->input('validity_date_from', array(
'type'=>'datetime',
'label' => 'validity date from',
'selected' => $this->data['Dpage']['validity_date_from'],
'empty' => true
));
well,
that's all.
thanks to all... anyway :)
On Sep 20, 5:54 pm, lorenx <[email protected]> wrote:
> hi all.
>
> i'm dealing with dates.
> in my form i would like to edit a DATE database field with the chance
> to save a null (or empty) value and, of course, the current option, if
> present, selected.
>
> this code does not display a label and i'm not able to pre-select the
> current database value:
> echo $form->datetime(
> 'validity_date_from',
> 'DMY', '24',
> $this->data['Dpage']['validity_date_from'],
> array(),
> true
> );
>
> with this code instead:
> echo $form->input('validity_date_from', array(
> 'type'=>'datetime',
> 'label' => 'validity date from',
> 'selected' => $this->data['Dpage']['validity_date_from'],
> 'showEmpty' => true
> ));
> i'm not able to show an empty value and the pre-selected option is not
> the one stored in the database but the present date-time.
>
> is it possible to join all my needs?
>
> thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---