PHP Class 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}.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TBaseValidator
Afficher le fichier Open project: pradosoft/prado Class Usage Examples

Méthodes publiques

Méthode Description
getInitialValue ( ) : string
setInitialValue ( $value )

Méthodes protégées

Méthode Description
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

Private Methods

Méthode Description
validateListControl ( $control )
validateRadioButtonGroup ( $control )
validateStandardControl ( $control )

Method Details

evaluateIsValid() protected méthode

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
Résultat boolean whether the validation succeeds

getClientClassName() protected méthode

This method overrides the parent implementation.
protected getClientClassName ( ) : string
Résultat string the javascript class name

getClientScriptOptions() protected méthode

Returns an array of javascript validator options.
protected getClientScriptOptions ( ) : array
Résultat array javascript validator options.

getControlPromptValue() protected méthode

protected getControlPromptValue ( ) : string
Résultat 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 méthode

public getInitialValue ( ) : string
Résultat 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 méthode

public setInitialValue ( $value )