Getting CakePHP HtmlHelper to generate a "date" input
I've been making some basic CRUD pages for my cakePHP app using the
HtmlHelper for the views. This is handy for building forms but for date
inputs the helper, by default generates 3 select boxes for the date which
is quite cumbersome to use.
HTML5 introduces the input[type=date] and most browsers now incorporate
some nice native interfaces to deal with it; e.g. Chrome produces a nice
date-picker for date inputs.
I know it is possible to make the HtmlHelper just make the input a text
box instead of the 3 dropdown by doing the following:
echo $this->Form->input('my_date', array('type' => 'text'));
But when I do
echo $this->Form->input('my_date', array('type' => 'date'));
it ignores the 2nd arguement and goes back to the 3 selects.
Is there a way to get the helper to make a date input?
No comments:
Post a Comment