Reputation: 1133
Inside a form in one of the view files, I generate a dropdown for specifying time like following:
echo $this->Form->input('start_time', array('label'=>false, 'timeFormat' => '24', 'interval'=> '10', 'selected' => '00:00','type'=>'time'));
it generates two dropdowns: one for hours and one for minutes. The preselected value is as stated 00:00. If no value is chosen, the dropdown shows current time.
What I want it to do instead, is to produce empty values, so the dropdown for hours would be like: " , 00, 01, 02..."
Upvotes: 1
Views: 270
Reputation: 13952
You can just pass through 'empty' => ''
as an extra param. And then, pass '' as the default value. Don't pass 'selected' at all.
Your code will look like this:
echo $this->Form->input('start_time', array('label'=>false, 'timeFormat' => '24', 'interval'=> '10', 'default' => '','type'=>'time', 'empty' => ''));
Upvotes: 2