You can set the minYear and maxYear in the form helper:
http://book.cakephp.org/view/480/options-minYear-options-maxYear

Then you just have to make sure your conditions are like:
array(
   'Event.date >=' => $this->data['Event']['min_date'],
   'Event.date <=' => $this->data['Event']['max_date']
)

Does that help?

On Sep 4, 6:14 am, dmsmitty <[email protected]> wrote:
> I'm creating a form using the forms helper to allow a user to search
> for events occurring within a specified date range.
>
> My model (called "Event") has a field called "date", which is of type
> DATE. I want to create 2 form inputs: a minimum and a maximum date
> range. My controller will have conditions for date <= maximum and date
>
> >= minimum.
>
> Is there a way to generate this using the Forms Helper?
>
> Thanks in advance,
> dmsmitty
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to