Version: current

     1 <?php
     2 /**
     3  * EditableHiddenField
     4  *
     5  * Allow users to define a validating time email field for a UserDefinedForm
     6  *
     7  * @package userforms
     8  */
     9
    10 class EditableHiddenField extends EditableFormField {
    11
    12     static $singular_name = 'Hidden Field';
    13
    14     static $plural_name = 'Hidden Fields';
    15
    16     function getFormField() {
    17         $f = new HiddenField($this->Name, $this->Title);
    18         if($this->getSetting('Value')) {
    19             $f->setValue($this->getSetting('Value'));
    20         }
    21         return $f;
    22     }
    23
    24     public function getFieldConfiguration() {
    25         $value = ($this->getSetting('Value')) ? $this->getSetting('Value') : '';
    26
    27         $fields = parent::getFieldConfiguration();
    28         $fields->push(new TextField($this->getSettingName('Value'), _t('EditableHiddenField.VALUE', 'Value'), $value));
    29         return $fields;
    30     }
    31 }

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -