Version: current

# Class CustomRequiredFields

Specify special required fields to be executed as part of form validation

  Object
  Validator
  RequiredFields
  CustomRequiredFields

Package: forms\validators
Located at sapphire/forms/CustomRequiredFields.php

## Methods summary

`public` | # `__construct( mixed $required )` Pass each field to be validated as a seperate argument Pass each field to be validated as a seperate argument #### Parameters $required $required array The list of required fields #### Overrides `RequiredFields::__construct`
`public` | # `javascript( )` Creates the client side validation from form fields which is generated at the header of each page Creates the client side validation from form fields which is generated at the header of each page #### Overrides `RequiredFields::javascript`
`public` | # `php( mixed $data )` Creates the server side validation from form fields which is executed on form submission Creates the server side validation from form fields which is executed on form submission #### Overrides `RequiredFields::php`
`public` | # `appendRequiredFields( mixed $requiredFields )` allows you too add more required fields to this object after construction. allows you too add more required fields to this object after construction. #### Overrides `RequiredFields::appendRequiredFields`

### Methods inherited from RequiredFields

`addRequiredField()`, `debug()`, `fieldIsRequired()`, `getRequired()`, `removeRequiredField()`, `removeValidation()`, `useLabels()`

### Methods inherited from Validator

`getCombinedError()`, `getError()`, `getErrors()`, `getJavascriptValidationHandler()`, `get_javascript_validator_handler()`, `includeJavascriptValidation()`, `requireField()`, `setForm()`, `setJavascriptValidationHandler()`, `set_javascript_validation_handler()`, `showError()`, `validate()`, `validationError()`

### Methods inherited from Object

`__call()`, `__toString()`, `__wakeup()`, `addMethodsFrom()`, `addStaticVars()`, `addWrapperMethod()`, `add_extension()`, `add_static_var()`, `allMethodNames()`, `cacheToFile()`, `cacheToFileWithArgs()`, `clearCache()`, `combined_static()`, `create()`, `createMethod()`, `create_from_string()`, `defineMethods()`, `exists()`, `extInstance()`, `extend()`, `getCustomClass()`, `getExtensionInstance()`, `getExtensionInstances()`, `get_extensions()`, `get_static()`, `hasExtension()`, `hasMethod()`, `has_extension()`, `invokeWithExtensions()`, `is_a()`, `loadCache()`, `parentClass()`, `parse_class_spec()`, `remove_extension()`, `sanitiseCachename()`, `saveCache()`, `set_stat()`, `set_static()`, `set_uninherited()`, `stat()`, `strong_create()`, `uninherited()`, `uninherited_static()`, `useCustomClass()`

### Magic methods summary

## Properties summary

`protected mixed` | $required | #

### Properties inherited from RequiredFields

`$useLabels`

### Properties inherited from Validator

`$errors`, `$form`, `$javascriptValidationHandler`, `$javascript_validation_handler`

### Properties inherited from Object

`$class`, `$extension_instances`, `$extensions`

[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. -