Defining an interval for minutes

Published on and tagged with cakephp  helper

Just noticed that you can define an interval for minutes when using the form helper (up to now I used my own little helper to accomplish this).

In the following example I use an interval of 15 minutes, i.e. the generated select box for the minutes only contains the values “00”, “15”, “30”, and “45”:

echo $form->input('start', array('type' => 'time', 'interval' => 15));

The default interval is one minute, but from the user’s point of view it is not that user-friendly to have a select box with 60 values, so I recommend to specify a different interval as shown above.

3 comments baked

Bake a comment

(for code please use <code>...</code> [no escaping necessary])

© daniel hofstetter. Licensed under a Creative Commons License