PHP Класс Prado\Web\UI\WebControls\TRequiredFieldValidator

TRequiredFieldValidator makes the associated input control a required field. The input control fails validation if its value does not change from the {@link setInitialValue InitialValue} property upon losing focus. Validation will also succeed if input is of TListControl type and the number of selected values different from the initial value is greater than zero. If the input is of TListControl type and has a {@link TListControl::setPromptValue PromptValue} set, it will be automatically considered as the validator's {@link setInitialValue InitialValue}.
С версии: 3.0
Автор: Qiang Xue ([email protected])
Наследование: extends TBaseValidator
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
getInitialValue ( ) : string
setInitialValue ( $value )

Защищенные методы

Метод Описание
evaluateIsValid ( ) : boolean This method overrides the parent's implementation.
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing validation for this control.
getClientScriptOptions ( ) : array Returns an array of javascript validator options.
getControlPromptValue ( ) : string

Приватные методы

Метод Описание
validateListControl ( $control )
validateRadioButtonGroup ( $control )
validateStandardControl ( $control )

Описание методов

evaluateIsValid() защищенный Метод

The validation succeeds if the input component changes its data from the {@link getInitialValue InitialValue} or the input control is not given. Validation will also succeed if input is of TListControl type and the number of selected values different from the initial value is greater than zero.
protected evaluateIsValid ( ) : boolean
Результат boolean whether the validation succeeds

getClientClassName() защищенный Метод

This method overrides the parent implementation.
protected getClientClassName ( ) : string
Результат string the javascript class name

getClientScriptOptions() защищенный Метод

Returns an array of javascript validator options.
protected getClientScriptOptions ( ) : array
Результат array javascript validator options.

getControlPromptValue() защищенный Метод

protected getControlPromptValue ( ) : string
Результат string the initial value of the associated input control. Defaults to empty string. If the associated input control does not change from this initial value upon postback, the validation fails.

getInitialValue() публичный Метод

public getInitialValue ( ) : string
Результат string the initial value of the associated input control. Defaults to empty string unless the control has a prompt value set. If the associated input control does not change from this initial value upon postback, the validation fails.

setInitialValue() публичный Метод

public setInitialValue ( $value )