dev-master
9999999-devSimple dropdown field which displays a text field when 'Other' is selected. Great for Honorifics selects.
BSD-3-Clause
The Requires
by james Ayers
cms silverstripe field forms alternative
Simple dropdown field which displays a text field when 'Other' is selected. Great for Honorifics selects.
Simple dropdown field which displays a text field when 'Other' is selected. Great for Honorific selects., (*1)
Add the dropdown options to the _config/AlternativeFormField.yml file., (*2)
You can also edit the empty string for the dropdown and the label for the 'other' field in the yml., (*3)
SilverStripe 3.0 or higher is required., (*4)
<?php public function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldsToTab("Root.Whatever", array( AlternativeFormField::create('Honorific', 'Honorific'), TextField::create('FirstName', 'First name'), TextField::create('Surname', 'Last name') )); return $fields; }
Simple dropdown field which displays a text field when 'Other' is selected. Great for Honorifics selects.
BSD-3-Clause
cms silverstripe field forms alternative