$host

PropertyDescriptionException
apptypeReturns the application type of the host. Available only for client applications.Returns HTML 5.
nameReturns the name of the current application.Returns the browser name and its version. For example, in Chrome browser, the value returned is Chrome <version>.
numPagesReturns the number of pages in the document.Pagination policy of HTML5 forms is not identical to PDF forms pagination policy. So the numPages API can return a different values in both the cases.
platformReturns a string representing the platform of the computer running the script.None
titleSpecifies the title of the document. It is available only for client applications.It returns title of HTML document in form, rather than the form metadata title as if there are PDF Forms.
versionReturns a string representing the version number of the current application.It returns the version of the form.
calculationsEnabledSpecifies whether calculate scripts will execute.None
validationsEnabledSpecifies whether validation scripts will execute.None
pageUpGoes to the previous page.HTML5 forms do not follow the same pagination policy as PDF Form, so the previous page of an HTML5 form is different from previous page of a PDF Form.
pageDownMoves to the next page of a form. Use the pageDown method at runtime.
setFocusSets the keyboard focus to the field specified. The field is specified as an object, or by the SOM expression of the field. It is available only for client applications.
resetdataResets the fields to their default values within a document.Clears all data in a form with merged data, rather than restoring it to default values.
messageBoxDisplays a dialog box on the screen. It is available only for client applicationsMessage box of type Yes/No is converted to OK/Cancel. Message box with three buttons is not supported.
currentPage

Sets the currently active page of a document at runtime.

Page values are 0-based, so the first page of a document returns a value of 0.

The currentPage property is available when layout:ready executes on a client. However, it is not available when layout:ready executes on the server because the property will not execute until the form layout executes.

None

field

PropertyDescriptionException
presenceControls the participation of the associated object in different phases of processing. If the object is a container, the contents of the container inherit whatever restrictions this control applies.None
accessControls user access to the contents.Does not work for the exclusion group. Moreover, HTML5 forms gives same treatment to non-interactive and protected objects.
nameAn identifier that is used to identify this element in script expressions.HTML5 forms do not allow setting name property for objects. It is read-only property for HTML5 forms.
valueA content element that encloses a single unit of data content.None
rawValueSpecifies the unformatted value for this field.None
formattedValueSpecifies the formatted value for this field.Setting formattedValue through script is not supported.
editValueSpecifies the edit value for this field.Setting editValue through script is not supported.
formatMessageSpecifies the format validation message string for this field.Setting formatMessage through script is not supported.
fillcolorSpecifies the background color value for this field. You need to set the border.fill.presence property to visible separately.It does not correctly return default color of the field.
borderThe border object describes the border surrounding an object.
uiThe ui object encloses the user interface description of a form object.
mandatorySpecifies the nullTest value for the field.
borderColorSpecifies the border color value for this field. You need to set the border.edge.presence property to visible separately.It does not correctly return default border color of the field.
lengthThe number of items in the list.None
addItemAdds new items to the current field.None
clearItemRemoves all the items from the field.None
boundItemGets the bound value of a specific display item of a drop-down list or list box.None
execCalculateExecutes the calculate script of the field.None
execValidateExecutes the validate script of the field.None
execEventExecutes the event script of the object.None
getItemStateReturns the selection state of the specified itemNone
setItemStateSets the selection state of the specified item.None
getDisplayItemRetrieves the item display text for the specified item index.None
getSaveItemRetrieves the data value for the specified item index.None
deleteItemDeletes the item at the specified index.None
setItemsSets the specified items in the current field. It replaces pre-existing items.None
hA measurement of the height for the layout.None
wA measurement specifying the width for the layout.None
xSpecifies the x coordinate of the container's anchor point relative to the upper-left corner of the parent container when placed with positioned layout.None
ySpecifies the y coordinate of a container's anchor point relative to the upper-left corner of the parent container when placed with positioned layout.None
captionThe caption object describes a descriptive label associated with a form design object.None
validateThe validate object controls validation of user-supplied data on a form. The validate object can be activated multiple times during the life of a form.None
parentSubformSpecifies the parent subform (page) of this field.Always returns parent subform instead of returning first non-scoping parent subform.
selectedIndexThe index of the first selected item.None

Form

PropertyDescriptionException
formNodesReturns a list of all form model objects that are bound to a specified data object.

InstanceManager

PropertyDescription
nameAn identifier that is used to identify this element in script expressions.
occurDescribes the constraints over the number of allowable instances for its enclosing container.
minSpecifies the minimum number of instances that can be instantiated.
maxSpecifies the maximum number of instances that can be instantiated.
countSpecifies the current number of instances instantiated.
setInstancesAdds or removes the specified subforms or subform sets from this node.
addInstanceAdds a new instance of a subform or subform set to this node.
removeInstanceRemoves a subform or subform set from this node.
moveInstanceMoves a child object of a form model object to another specified location within the form model. The corresponding data model information for the object is also relocated within the data model.
insertInstanceInserts a new instance of a subform or subform set to this node.

list

PropertyDescription
lengthThe number of elements in the list.
itemA zero-based index into the collection.
appendAppends a node to the end of the node list.
removeRemoves a node from the node list.
insertInserts a node before a specific node in the node list.

node

PropertyDescriptionException
createNodeCreates new node based on a valid class name.None
isContainerSpecifies whether this object is a container object.None
isNullIndicates whether the current data value is a null value.None
resolveNodeEvaluates the specified SOM expression, beginning with the current XML form object model object, and returns the value of the object specified in the SOM expression.None
resolveNodesEvaluates the specified SOM expression, beginning with the current XML form object model object, and returns the value of the object specified in the SOM expression.None
oneOfChildCreates new node based on a valid class name.None
getElementReturns a specified child object.None
getAttributeGets a specified property value.None
setAttributeSets the value of a specified property.None

model

PropertyDescriptionException
NANANA

Subform

PropertyDescriptionException
instanceIndexSpecifies the index of the object, relative to the other instantiated instances.None
execEventExecutes the event script of the object.None
getInvalidObjectsReturns a list of nodes contained within the subform (inclusive), that have failed the validation test.None
borderThe border object describes the border surrounding an object.None
borderColorSpecifies the border color value for this field. You need to set the border.edge.presence property to visible separately.None
hA measurement of the height for the layout.None
wA measurement specifying the width for the layout.None
xSpecifies the x coordinate of the container's anchor point relative to the upper-left corner of the parent container when placed with positioned layout.None
ySpecifies the y coordinate of a container's anchor point relative to the upper-left corner of the parent container when placed with positioned layout.None
validateThe validate object controls validation of user-supplied data on a form. The validate object can be activated multiple times during the life of a form.None
nameAn identifier that is used to identify this element in script expressions.None
presenceSpecifies an object's visibility.None
accessControls user access to the contents of a container object, such as a subform.None
execValidateCalculates the index of a subform or subform set based on where it is located relative to other instances of the same form object.None
instanceManagerThe instanceManager object manages the instance creation, removal, and movement of form model objects.None

submit

PropertyDescription
targetThe URL to which the data is submitted. Omission of this attribute implies the XFA processing application obtains the URI using a product-specific technique, such as accessing product-specific information in the config object.

tree

PropertyDescriptionException
nodesReturns a list of all child objects of the current object.
  • Not supported for xfa.nodes, desc
  • Number of nodes reported for PDF and HTML are different.
nameSpecifies the name of this node.Setting the name using scripts is not allowed in HTML.
parentGets the parent for this node.None
indexReturns the position of this node in its collection of like-named, in-scope, like-child relationship nodes.None
somExpressionGets the SOM expression for this node.None
resolveNodeEvaluates the specified SOM expression, beginning with the current XML form object model object, and returns the value of the object specified in the SOM expression.None
resolveNodesEvaluates the specified SOM expression, beginning with the current XML form object model object, and returns the value of the object specified in the SOM expression.None

subformset

PropertyDescriptionException
instanceManagerThe instanceManager object manages the instance creation, removal, and movement of form model objects.None

content

PropertyDescriptionException
isNullIndicates whether the current data value is the null value.

dataValue

PropertyDescriptionException
isNullIndicates whether the current data value is the null value.

edge

PropertyDescriptionException
colorThe color property describes a unique color for the pattern object.
  • The default value cannot be retrieved.
  • The changes are reflected in Model and are available for scripting but are not synced to HTML elements. Hence, the changes are not reflected in the UI.

fill

PropertyDescriptionException
colorThe color properties define a unique color of fill.
  • The default value cannot be retrieved.
  • The changes are reflected in Model and are available for scripting but are not synced to HTML elements. Hence, the changes are not reflected in the UI.

linear

PropertyDescriptionException
colorThe color property describes a unique color for a linear gradient fill on a form.
  • The default value cannot be retrieved.
  • The changes are reflected in Model and are available for scripting but are not synced to HTML elements. Hence, the changes are not reflected in the UI.

line

PropertyDescriptionException
edgeThe edge object describes an arc, line, or one side of a border or rectangle.Attributes such as color, cap, and more are not supported.

pattern

PropertyDescriptionException
colorThe color property describes a unique color for the pattern object.
  • The default value cannot be retrieved.
  • The changes are reflected in Model and are available for scripting but are not synced to HTML elements. Hence, the changes are not reflected in the UI.

radial

PropertyDescriptionException
colorThe color property describes a unique color for the radial object
  • The default value cannot be retrieved.
  • The changes are reflected in Model and are available for scripting but are not synced to HTML elements. Hence, the changes are not reflected in the UI.

stipple

PropertyDescriptionException
colorThe color property describes a unique color for the stipple object.
  • The default value cannot be retrieved.
  • The changes are reflected in model and are available for scripting but are not synced to HTML elements. Hence, the changes are not reflected in the UI.

draw

PropertyDescriptionException
uiThe ui object encloses the user interface description of a form object.
captionThe caption object describes a descriptive label associated with a form design object.
presenceSpecifies an object's visibility.
nameSpecifies an identifier that may be used to specify this object or event in script expressions.Setting the value at the runtime is not supported
valueThe value object encloses a single unit of data content.

corner

PropertyDescriptionException
colorThe color property describes a unique color for the corner object.
  • The default value cannot be retrieved.
  • The changes are reflected in model and are available for scripting but are not synced to HTML elements. Hence, the changes are not reflected in the UI.

checkButton

PropertyDescriptionException
borderThe border object describes the border surrounding checkButton object.The changes are reflected in model and are available for scripting but are not synced to HTML elements. Hence, the changes are not reflected in the UI.

choiceList

PropertyDescriptionException
borderThe border object describes the border surrounding choiceList object.

dateTimeEdit

PropertyDescriptionException
borderThe border object describes the border surrounding dateTimeEdit object.

Image

PropertyDescriptionException
contentTypeSpecifies the type of content in the referenced document, expressed as a MIME type.None
nameAn identifier that is used to identify this element in script expressions.None

imageEdit

PropertyDescriptionException
borderThe border object describes the border surrounding imageEdit object.

numericEdit

PropertyDescriptionException
borderThe border object describes the border surrounding an object.none

object

PropertyDescriptionException
classNameDetermines the name of the class of this object.none

rectangle

PropertyDescriptionException
edgeThe edge object describes an arc, line, or one side of a border or rectangle.Attributes such as color, cap, and more are not supported.

textEdit

PropertyDescriptionException
borderThe border object describes the border surrounding an object.None

exclGroup

PropertyDescriptionException
layoutSpecifies the layout strategy to be used by this object.None
borderSpecifies the border surrounding this field.None
mandatorySpecifies the nullTest value for the field.None
borderColorSpecifies the border color value for this field.A border must be defined before you can change the color by scripting.None
borderWidthSpecifies the border width for this field.None
hA measurement of the height for the layout.None
transientSpecifies whether the processing application must save the value of the exclusion group as part of a form submission or save operation.None
wA measurement specifying the width for the layout.None
xSpecifies the x coordinate of the container's anchor point relative to the upper-left corner of the parent container when placed with positioned layout.None
ySpecifies the y coordinate of a container's anchor point relative to the upper-left corner of the parent container when placed with positioned layout.None
captionThe caption object describes a descriptive label associated with a form design object.None
validateThe validate object controls validation of user-supplied data on a form. The validate object can be activated multiple times during the life of a form.None
dataNodeGets the data node to which a form node is bound after merge.None
presenceSpecifies an object's visibility.
accessControls user access to the contents of a container object, such as a subform.For individual items in the exclgrp, it always returns open.
nameSpecifies an identifier that may be used to specify this object or event in script expressions.None
membersSpecify the members of exclusion group.None
selectedMemberReturns the selected member of an exclusion group.None
execCalculateExecutes any scripts on the calculate event of the specified object, and any child objects.None
calculateThe calculate object controls the calculation of a field's value.None

arc

PropertyDescriptionException
edgeThe edge object describes an arc, line, or one side of a border or rectangle.Attributes such as color, cap, and more are not supported.

border

PropertyDescriptionException
edgeThe edge object describes an arc, line, or one side of a border or rectangle.Attributes such as color, cap, and more are not supported.

$layout

PropertyDescriptionException
hDetermines the height of a given form design object.
  • Height (h) property is not supported for page area and content area.
  • Parameter 'Offset from first content area the XFA-Form object occurs on' is not supported.
wDetermines the width of a given form design object.
  • Width (w) property is not supported for page area and content area.
  • Parameter 'Offset from first content area the XFA-Form object occurs on' is not supported.
xDetermines the x coordinate of a given form design object relative to its parent object.
  • x coordinate (x) property is not supported for page area and content area.
  • Parameter 'Offset from first content area the XFA-Form object occurs on' is not supported.
yDetermines the y coordinate of a given form design object relative to its parent object.
  • y coordinate (y) property is not supported for page area and content area.
  • Parameter 'Offset from first content area the XFA-Form object occurs on' is not supported.
pagecountDetermines the number of pages of the current form.
  • layout.pageCount() method returns different values for PDF and HTML forms.
  • On decreasing page count by hiding an object, abspagecount method returns incorrect value.
pagecontentRetrieves types of form design objects from a specified page of a form.None
absPageCountDetermines the page count of the current form.
  • layout.pageCount() method returns different values for PDF and HTML forms.
  • On decreasing page count by hiding an object, abspagecount method returns incorrect value.

items

PropertyDescriptionException
presenceSpecifies an object’s visibility.None

FormCalc

FormCalc is an XFA-specific language for creating e-form centric logic and calculations roots. FormCalculation provides a powerful set of build functions.

FormCalc Supported Functions

FormCalc Expression Support

CategoryDescriptionSample
Simple ExpressionAdd, subtract, multiply, divide, and parentheses(a+b)*3
Variable declarationDefine a variablevar a
var a=3
a=3
Logical expression
  • Logic (and/or)
  • Comparison (greater/less/ equal)
A or 1
1 <> 2
A NE B
A or 1
1 <> 2
A NE B
If expressionif (a>b) then 2 endif
whilewhile (i lt 5) do i = i + 1 endwhile
forfor i = 100 downto 1
do s = s + i endfor
for eachfor each i in (1, 2, 3)
do s = s + i endfor
function declarationDefine a custom function in FormCalcfunc foo(n) do var f = n endfunc

Acrobat API Support

  1. Arithmetic Functions

    1. Abs()
    2. Avg()
    3. Ceil()
    4. Count()
    5. Floor()
    6. Max()
    7. Min()
    8. Mod()
    9. Round()
    10. Sum()
  2. Scientific Functions

    1. Acos()
    2. Asin()
    3. Atan()
    4. Atan2()
    5. Cos()
    6. Sin()
    7. Tan()
    8. Exp()
    9. Log()
    10. Pow()
    11. Sqrt()
    12. Deg2Rad()
    13. Rad2Deg()
    14. Pi()
  3. Financial Functions

    1. Apr()
    2. Cterm()
    3. Fv()
    4. Ipmt()
    5. Npv()
    6. Pmt()
    7. Ppmt()
    8. Pv()
    9. Rate()
    10. Term()
  4. Logical Functions

    1. Choose()
    2. If()
    3. Oneof()
    4. Within()
  5. String Functions

    1. At()
    2. Concat()
    3. Left()
    4. Len()
    5. Lower()
    6. Ltrim()
    7. Replace()
    8. Right()
    9. Rtrim()
    10. Space()
    11. Stuff()
    12. Substr()
    13. Upper()
    14. WordNum()
  6. Date and Time

    1. Date()
    2. num2date()
    3. DateFmt()
APIDescriptionAberration
console.println()This acrobat API dumps the output toJavaScript console.
app.alert()This acrobat API sends out an alert message throughJavaScript popup.
app.beep()Causes the system to play a sound.No action is performed.
app.execDialog()Presents a modal dialog box to the user. Modal dialog boxes must be closed by the user before the host application can be directly used again.No action is performed.
app.launchURL()Launches a URL in a browser window.
app.setInterval()Specifies a JavaScript script and a time period. The script is executed every time the period elapses. The return value of this method must be held in a JavaScript variable. Otherwise, the interval object is subject to garbage-collection, which would cause the clock to stop. To terminate the periodic execution, pass the returned interval object to clearInterval.
app.setTimeOut()Specifies a JavaScript script and a time period. The script is executed one time only, after the period elapses.The return value of this method must be held in a JavaScript variable. Otherwise, the timeout object is subject to garbage-collection, which would cause the clock to stop. To cancel the timeout event, pass the returned timeout object to clearTimeOut.
app.clearInterval()Cancels a previously registered interval initially set by the setInterval method.In HTML5 forms, the API does not function correctly.
app.clearTimeOut()Cancels a previously registered time-out interval. Such an interval is initially set by setTimeOut.In HTML5 forms, the API does not function correctly.
app.eval()Runs a given script.
app.activeDocsAn array containing the Doc object for each active document. If no documents are active, activeDocs returns nothing; that is, it has the same behavior as d = new Array(0) in core JavaScript.Returns an empty array for HTMl5 forms.
app.calculateIf true (the default value), calculations can be performed. If false, calculations are not permitted.Always true for HTMl5 Forms.
app.constantsA wrapper object for holding various constant values. Currently, this property returns an object with a single property, align.HTML5 forms return an empty align object.
app.focusRectTurns the focus rectangle on and off. The focus rectangle is the faint dotted line around buttons, check boxes, radio buttons, and signatures to indicate that the form field has the keyboard focus. A value of true turns on the focus rectangle.Always true for HTML5 forms.
app.formsVersionThe version number of the viewer forms software. Check this property to determine whether objects, properties, or methods in newer versions of the software are available if you want to maintain backward compatibility in your scripts.11.001 always.
app.languageThe language of the running Acrobat viewer.Always "ENU" for HTMl5 forms.

Supported XFA events

The following client sided XFA events are supported:

  • Initialize
  • Validate
  • Calculate
  • Click
  • Enter
  • Exit
  • Change
  • ValidationState
NOTE
HTML5 forms are rendered on the client-side (browser). Use client side validate and calculate scripts instead of server-sided scripts.

Experience Manager


Espressos & Experience Manager: AEM Forms

Espressos & Experience Manager

Thursday, Mar 6, 7:00 PM UTC

Join Adobe's AEM product team as they highlight AEM Forms' latest innovations, including: the new Gen AI Assistant, Unified Composition with AEM Sites, and new ways to deploy forms through conversations.

Register

Connect with Experience League at Summit!

Get front-row access to top sessions, hands-on activities, and networking—wherever you are!

Learn more