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

Adding an Enumeration to a DropDownField

(2116 views. Last Updated: 2007-08-14 2:27 AM)

Here are 2 examples:
1. Colors and their numeric mappings:
$array1 = array("green", "red", "blue");
$array2 = array("0", "1", "2");
$ffBean->addField(new DropDownField("color", "Color", FORM_FIELD_REQUIRED, $array1, $array2, "[Select One]"));
2. A StateField which retrieves the full state name instead of just the 2 character abbreviation:
$stateField = new StateField("state", "State", FORM_FIELD_REQUIRED, " ");
$ffForm->addField(new DropDownField("state", "State", FORM_FIELD_REQUIRED, $stateField->ENUM_STATES, $stateField->ENUM_STATES, "[Select One]"));
Support | Earn Money
Copyright © 2005-2020 Brain Book Software LLC.
Built with FORMfields, the premiere web framework.