PHP Класс Prado\Web\UI\WebControls\TCustomValidator
TCustomValidator performs user-defined validation (either
server-side or client-side or both) on an input component.
To create a server-side validation function, provide a handler for
the {@link onServerValidate OnServerValidate} event that performs the validation.
The data string of the input control to validate can be accessed
by {@link TServerValidateEventParameter::getValue Value} of the event parameter.
The result of the validation should be stored in the
{@link TServerValidateEventParameter::getIsValid IsValid} property of the event
parameter.
To create a client-side validation function, add the client-side
validation javascript function to the page template.
The function should have the following signature:
Use the {@link setClientValidationFunction ClientValidationFunction} property
to specify the name of the client-side validation script function associated
with the TCustomValidator.
Показать файл
Открыть проект
Примеры использования класса
Открытые методы
Защищенные методы
Описание методов
evaluateIsValid()
публичный метод
The validation succeeds if {@link onServerValidate} returns true.
getClientClassName()
защищенный метод
This method overrides the parent implementation.
getClientScriptOptions()
защищенный метод
Returns an array of javascript validator options.
getClientValidationFunction()
публичный метод
getValidationTarget()
публичный метод
public getValidationTarget ( ) : TControl |
Результат |
TControl |
control to be validated. Null if no control is found. |
onServerValidate()
публичный метод
It will raise the OnServerValidate event.
The method also allows derived classes to handle the event without attaching a delegate.
Note The derived classes should call parent implementation
to ensure the OnServerValidate event is raised.
registerClientScriptValidator()
защищенный метод
Only register the client-side validator if
{@link setClientValidationFunction ClientValidationFunction} is set.
setClientValidationFunction()
публичный метод
Sets the name of the custom client-side script function used for validation.