public function getFieldValidationOptions()
    {
        $fields = new FieldList(
            CheckboxField::create('Required', _t(__CLASS__.'.REQUIRED', 'Is this field Required?'))
                ->setDescription(_t(__CLASS__.'.REQUIRED_DESCRIPTION', 'Please note that conditional fields can\'t be required')),
            TextField::create('CustomErrorMessage', _t(__CLASS__.'.CUSTOMERROR', 'Custom Error Message'))
        );

        $this->extend('updateFieldValidationOptions', $fields);

        return $fields;
    }
public function getFieldValidationOptions()
    {
        $fields = new FieldList(
            CheckboxField::create('Required', _t(__CLASS__.'.REQUIRED', 'Is this field Required?'))
                ->setDescription(_t(__CLASS__.'.REQUIRED_DESCRIPTION', 'Please note that conditional fields can\'t be required')),
            TextField::create('CustomErrorMessage', _t(__CLASS__.'.CUSTOMERROR', 'Custom Error Message'))
        );

        $this->extend('updateFieldValidationOptions', $fields);

        return $fields;
    }
public function getFieldValidationOptions ( ) { $ fields = new FieldList ( CheckboxField :: create ( 'Required' , _t ( __CLASS__ . '.REQUIRED' , 'Is this field Required?' ) ) -> setDescription ( _t ( __CLASS__ . '.REQUIRED_DESCRIPTION' , 'Please note that conditional fields can\'t be required' ) ) , TextField :: create ( 'CustomErrorMessage' , _t ( __CLASS__ . '.CUSTOMERROR' , 'Custom Error Message' ) ) ) ; $ this -> extend ( 'updateFieldValidationOptions' , $ fields ) ; return $ fields ; }
Append custom validation fields to the default 'Validation'
section in the editable options view

@return FieldList
Append custom validation fields to the default Validation section in the editable options view