Description and example of infopath form event list

Source: Internet
Author: User
Infopath Form event list description and example use

I. event list:

Name

Event Handlers

Description

DatadomeventObject

Onbeforechange

Onvalidate

Onafterchange

Returns a reference to a form's underlying XML document, the return status, and other properties that contain information about the XML Node during an XMLDocument Object Model (DOM)Change. Also except des a method for raising an error.

DocactioneventObject

Onclick

Returns a reference to a form's underlying XML document, the return status, and the source XML Node during a button click in the form area.

DoccontextchangeeventObject

Oncontextchange

Returns information about the XML Document Object Model (DOM) node that is the current context of the form's underlying XML document.

DoceventObject

Onswitchview

Onafterimport

Returns a reference to a form's underlying XML document during a switch view or form merge operation.

DocreturneventObject

Onload

Onsubmitrequest

Returns a reference to a form's underlying XML document and the return status during the loading or submission of a form.

MergeeventObject

Onmergerequest

Returns properties and methods that can be used during an onmergerequest event to programmatically interact with a form's underlying XML document and to determine merge properties such as the number of files being merged.

SaveeventObject

Onsaverequest

Returns a number of properties and methods that can be used during a save operation from the onsaverequest event handler to programmatically interact with a form's underlying XML document, determine save properties, and perform the save operation.

SigneventObject

Onsign

Used to add additional data to the digital signature.

VersionupgradeeventObject

Onversionupgrade

Returns a reference to a form's underlying XML document, the return status, and the document and solution version numbers during the version upgrade operation.

 

Ii. Example:

// ========

// The following function handler is created by Microsoft Office infopath.

// Do not modify the name of the function or the name and number of arguments.

// ========

Function xdocument: onload (eventobj)

{

// Write your code here.

}

 

Function msoxd _ myfield_attr: onbeforechange (eventobj)

{

// Determine whether there is a new value.

If (eventobj. newvalue = "")

{

// The value is blank, so display an error message and roll back the changes.

Eventobj. returnmessage = "you must supply a value for this field .";

Eventobj. returnstatus = false;

Return;

}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.