Share via


DataDOMEvent.ReturnStatus Property

InfoPath Developer Reference

Sets or retrieves a Boolean value indicating the return status of the data validation event. Read/write

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.ReturnStatus

expression   An expression that returns a DataDOMEvent object.

Return Value
Boolean

Remarks

If the ReturnStatus property is set to False, the changes to the XML Document Object Model (DOM) node are not accepted and the data validation event fails. If set to True, no data validation error has occurred and the data validation event is successful.

Security Level 2: Can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

Example

In the following example, the ReturnStatus property of the DataDOMEvent object is used to indicate that the data validation event was not successful. The code also uses the ReturnMessage property of the DataDOMEvent object to display a message to the user.

JScript
  function msoxd__id_attr::OnBeforeChange(eventObj)
{
   if (eventObj.NewValue == "")
   {
      eventObj.ReturnMessage = "You must supply a value for this field.";
      eventObj.ReturnStatus = false;
      return;
   }
}

See Also