PHP Class 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.
Datei anzeigen
Open project: pradosoft/prado
Class Usage Examples
Public Methods
Protected Methods
Method Details
evaluateIsValid()
public method
The validation succeeds if {@link onServerValidate} returns true.
getClientClassName()
protected method
This method overrides the parent implementation.
getClientScriptOptions()
protected method
Returns an array of javascript validator options.
getClientValidationFunction()
public method
getValidationTarget()
public method
public getValidationTarget ( ) : TControl |
return |
TControl |
control to be validated. Null if no control is found. |
onServerValidate()
public method
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()
protected method
Only register the client-side validator if
{@link setClientValidationFunction ClientValidationFunction} is set.
setClientValidationFunction()
public method
Sets the name of the custom client-side script function used for validation.