DataDOM.OnValidate Event
InfoPath Developer Reference |
Occurs after changes to a form's underlying XML document have been accepted but before the OnAfterChange event occurs.
Version Information
Version Added: InfoPath 2003
Syntax
expression.OnValidate(pDataDOMEvent)
expression An expression that returns a DataDOM object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
pDataDOMEvent | Required | DataDOMEvent | An event object that is used during Microsoft Office InfoPath 2007 data validation events. |
Return Value
nothing
Remarks
This event handler does not allow users to cancel an operation.
During the OnValidate event, the form's underlying XML document is placed in read-only mode.
The OnValidate event is typically used for handling errors and working with the Errors collection—for example, adding new errors or deleting existing ones.
Note |
---|
In some cases, events related to changes in a form's underlying XML document may occur more than once. For example, when existing data is changed, an insert and delete operation occurs. |
Example
In the following partial example, the OnValidate event handler is used to validate contact information. If the data is invalid, the ReportError method of the DataDOMEVent object is used to create an error.
JScript |
---|
|
See Also