FORMfields, the premiere web framework
Support Home | Knowledge Base | Documentation | Forums | Contact Us
FORMfields & FORMgen :: Field Customizations

Restricting Minutes So Time is on the Hour or Half Hour

(1259 views. Last Updated: 2007-08-13 6:57 PM)

Here's how to restrict the selection of a time to times on the hour or half hour.

Edit your form and replace:
$ffForm->addField(new TimeField("time", "Time", FORM_FIELD_REQUIRED));
$ffForm->addField(new TimeField("time", "Time", FORM_FIELD_REQUIRED));
$minValues = array("00", "30");
$ffForm->formFields["time"]->min->options = $minValues;
$ffForm->formFields["time"]->min->values = $minValues; 

Note: This customization works with TimeFields and TwentyFourHourTimeFields.
Support | Earn Money
Copyright © 2005-2020 Brain Book Software LLC.
Built with FORMfields, the premiere web framework.