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

Adding an Enumeration to a DropDownField

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