TBaseValidator serves as the base class for validator controls.
Validation is performed when a postback control, such as a TButton, a TLinkButton
or a TTextBox (under AutoPostBack mode) is submitting the page and
its CausesValidation property is true.
You can also manually perform validation by calling {@link TPage::validate()}.
The input control to be validated is specified by {@link setControlToValidate ControlToValidate}.
Validator controls always validate the associated input control on the serve side.
In addition, if {@link getEnableClientScript EnableClientScript} is true,
validation will also be performed on the client-side using javascript.
Client-side validation will validate user input before it is sent to the server.
The form data will not be submitted if any error is detected. This avoids
the round-trip of information necessary for server-side validation.
You can use multiple validator controls to validate a single input control,
each responsible for validating against a different criteria.
For example, on a user registration form, you may want to make sure the user
enters a value in the username text box, and the input must consist of only word
characters. You can use a {@link TRequiredFieldValidator} to ensure the input
of username and a {@link TRegularExpressionValidator} to ensure the proper input.
If an input control fails validation, the text specified by the {@link setErrorMessage ErrorMessage}
property is displayed in the validation control. However, if the {@link setText Text}
property is set, it will be displayed instead. If both {@link setErrorMessage ErrorMessage}
and {@link setText Text} are empty, the body content of the validator will
be displayed. Error display is controlled by {@link setDisplay Display} property.
You can also customized the client-side behaviour by adding javascript
code to the subproperties of the {@link getClientSide ClientSide}
property. See quickstart documentation for further details.
You can also place a {@link TValidationSummary} control on a page to display error messages
from the validators together. In this case, only the {@link setErrorMessage ErrorMessage}
property of the validators will be displayed in the {@link TValidationSummary} control.
Validators can be partitioned into validation groups by setting their
{@link setValidationGroup ValidationGroup} property. If the control causing the
validation also sets its ValidationGroup property, only those validators having
the same ValidationGroup value will do input validation.
Note, the {@link TPage::getIsValid IsValid} property of the current {@link TPage}
instance will be automatically updated by the validation process which occurs
after {@link TPage::onLoad onLoad} of {@link TPage} and before the postback events.
Therefore, if you use the {@link TPage::getIsValid()} property in
the {@link TPage::onLoad()} method, you must first explicitly call
the {@link TPage::validate()} method.
Notes to Inheritors When you inherit from TBaseValidator, you must
override the method {@link evaluateIsValid}.