2017 © Pedro Peláez
 

silverstripe-module alternative-field

Simple dropdown field which displays a text field when 'Other' is selected. Great for Honorifics selects.

image

leapfrognz/alternative-field

Simple dropdown field which displays a text field when 'Other' is selected. Great for Honorifics selects.

  • Monday, October 14, 2013
  • by Leapfrognz
  • Repository
  • 2 Watchers
  • 2 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 5 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Silverstripe Alternative-field Module

Introduction

Simple dropdown field which displays a text field when 'Other' is selected. Great for Honorific selects., (*1)

How to use

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)

Requirements

SilverStripe 3.0 or higher is required., (*4)

Example

<?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;
    }

The Versions

14/10 2013

dev-master

9999999-dev

Simple dropdown field which displays a text field when 'Other' is selected. Great for Honorifics selects.

  Sources   Download

BSD-3-Clause

The Requires

 

by james Ayers

cms silverstripe field forms alternative