Wednesday, October 1, 2008

Re: Get month, day, year helper to put dates in an array

http://book.cakephp.org/view/547/Field-naming-convention

On Sep 29, 5:02 pm, Tony Thomas <truet...@gmail.com> wrote:
> I'm using the form helpers for month, day & year to record several
> start and end dates. What I'd like is for each respective helper to
> create an array of months, days & years. I don't think there's a way
> to do that with the helper the way it is, is there?
>
> Right now $form->month('Model.field', date('m'), FALSE)
>
> produces:
>
> <select name="data[Model][field][month]" 0="0"
> id="ModelFieldMonth">...etc. </select>
>
> What I'd really like is:
>
> <select name="data[Model][field][month][]" 0="0"
> id="ModelFieldMonth">...etc. </select>
>
> The user will be reporting several dates and I'd like to loop through
> the array and insert the dates into a table. Unfortunately as it is,
> only the last date will be recorded. Anyone have any advice for me
> aside from hand coding the form?
--~--~---------~--~----~------------~-------~--~----~
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: