Site Property

Microsoft Office InfoPath

A read-only property that returns a reference to the XML Document Object Model (DOM) node where the data validation event is currently being processed.

expression.Site

expression    Required. Returns a reference to the DataDOMEvent object.

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.

Remarks

After you have set a reference to the XML DOM node that the Site property returns, you can use any of the properties and methods that are supported by the XML DOM.

Note  To learn more about the XML DOM and all of the properties and methods that it supports, see the MSXML 5.0 SDK documentation in the Microsoft Script Editor (MSE) Help system.

Example

In the following example from the Data Validation developer sample form, the Site property of the DataDOMEvent object is used to check the value of the XML DOM node; if it matches certain criteria, an error is created:

function msoxd__itemB_quantityListB::OnValidate(eventObj)
{
   if (parseInt(eventObj.Site.nodeTypedValue, 10) > 50)
      eventObj.ReportError(eventObj.Site, "Invalid quantity.  " +
         "The total number of each type of block cannot exceed 50.", false);

   if (parseInt(eventObj.Site.nodeTypedValue, 10) < 0)
      eventObj.ReportError(eventObj.Site, "Invalid quantity.  " +
         "The total number of each type of block cannot be less than 0.", false);
}