The ValidationError event has different arguments for different objects:
Object |
See |
---|---|
For use with PSWebDataWindowClass objects, see ValidationError in the chapter on server-side Web DataWindow events.
Occurs if the psPage.Validate event returns false or if any control's Validate event returns false.
None
None
Use this event to report any validation errors.
One way of reporting validation errors is to place an error message in a Static Text control that you make visible when an error is detected. Another way is to call the Alert method to open a client-side alert box after the page is displayed. A third way is to call ReportError.
The first two ways display validation errors to the client. If you want to plug validation errors into the standard error processing mechanism, use ReportError.
Error processing
Because this event is triggered before generation occurs, psDocument.Write cannot
be used for reporting errors. Instead, you can use the ReportError method
on the psPage object to trigger the ServerError event. The error
is then added to the error log, depending on the ServerError return
value.
This code in the ValidationError event for a logon window makes visible a previously hidden Static Text control (containing text indicating an invalid password). It also sets the logonValid variable to false:
st_invalid.visible = true;
logonValid = false;
Occurs if the control.Validate event fails.
PSPasswordClass, PSTextAreaClass, PSTextAreaClass
Argument |
Description |
---|---|
sNewValue |
String variable for the user-entered value that fails the control.Validate test |
None
Use this event to report validation errors on user-entered data.