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

Restricting Minutes So Time is on the Hour or Half Hour

(1179 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));
with:
$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.
Info
Support | Earn Money
Copyright © 2005-2019 Brain Book Software LLC.
Built with FORMfields, the premiere web framework.