XDocument.IsDirty Property

InfoPath Developer Reference

A read-only property that returns a Boolean value that indicates whether the data in a Microsoft Office InfoPath 2007 form has been modified since it was last saved. Read-only

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.IsDirty

expression   An expression that returns a XDocument object.

Return Value
Boolean

Remarks

If the IsDirty property is True, data in the form's underlying XML document has been changed since it was last saved. If False, no changes have occurred.

Bb250793.vs_note(en-us,office.12).gif  Note
Changes that occur during the OnLoad event will not result in the IsDirty property being set to True.

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 IsDirty property of the XDocument object is used to determine whether data in the form has been changed:

JScript
  if (XDocument.IsDirty)
   XDocument.UI.Alert("Data has been changed.");
else
   XDocument.UI.Alert("Data has not been changed.");

See Also