Thanks Jeremy that's exactly what i wanted to do i mean check wether
the user has entered a date greater than the current day ,month
through validation but i did fail.Am more of a newbie in programing.
On Jun 23, 11:17 am, Jeremy Burns | Class Outfit
wrote:
> That's going to be hard really. First
That's going to be hard really. First I'd adapt the code sample (change maxYear
to date('Y') which will give you this year and the previous 100 (which is
probably enough for most people). If you limit the months to (say) June, how
would I enter my birthday which is in a previous year but in July
Thanks for that response but that's not what i was looking for,what i
need is for the form to only display previous month up to the current
one.Am trying to not let users be able to enter a birthday that is not
greater than the current day or month
On Jun 23, 10:35 am, Jeremy Burns | Class Outfit
Do you mean in the form? If so, yes. For example, this code will give you a
date field (without time) where the year is the the range [this year -100] and
[this year -18]:
$form->input(
'dob',
array(
'type' => 'datetime',
'empty' => true,
Is there a way to limit months just like maxYear or minYear? this
would be a lot more easier.
On Jun 22, 2:28 pm, Jeremy Burns | Class Outfit
wrote:
> Sorry - just read the post properly and my answer wasn't your solution, but
> it can be adapted. The key is to write a function and within that c
Sorry - just read the post properly and my answer wasn't your solution, but it
can be adapted. The key is to write a function and within that compare
$check['dob'] with today's date.
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 22 Jun 2010, at 12:12, Jere
Add this to your model validation (assuming the field you are checking is
called 'dob'):
'dob' => array(
'inRange' => array(
'rule' => 'isAgeInAcceptedRange',
'message' => 'You must be between the ages of 18 and 80.'
)
),
Then add this function t
I have been using cakephp for a few weeks now but i have failed to
know how to validate a date for example a birthday to make sure it's
now greater than the current date.Could anyone point me to the right
direction
Check out the new CakePHP Questions site http://cakeqs.org and help others with
th