Scripting support for HTML5 forms
- Applies to:
- Experience Manager 6.5
- Topics:
- HTML5 Forms,Mobile Forms
CREATED FOR:
- Admin
- User
- Developer
JavaScript, FormCalc properties, and methods supported in HTML5 forms are as listed below:
$event
Property | Description | Exception |
---|---|---|
prevText | Specifies the content of the field before it changes in response to the actions of a user. This value can be recalled, similar to an undo feature. |
Does not work for drop-downs and list boxes.
Setting value through script is not supported. |
target | Specifies the object upon which the event is acting. | Setting value through script is not supported. |
newtext | Specifies the content of the field after it changes in response to user actions. |
The
Setting value through script is not supported. |
change | Specifies the value that a user types or pastes into a field immediately after they perform the action. |
The change property does not work properly for following cases:
Setting value through script is not supported. |
keydown | Determines whether a user is pressing an arrow key to make a selection. This property is available only for list boxes and drop-down lists. | None |
modifier | Determines whether the modifier key (for example, Ctrl on Microsoft® Windows®) is held down when a particular event executes. | None |
$host
Property | Description | Exception |
---|---|---|
apptype | Returns the application type of the host. Available only for client applications. | Returns HTML 5 . |
name | Returns the name of the current application. | Returns the browser name and its version. For example, in Chrome browser, the value returned is Chrome <version>. |
numPages | Returns 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. |
platform | Returns a string representing the platform of the computer running the script. | None |
title | Specifies 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. |
version | Returns a string representing the version number of the current application. | It returns the version of the form. |
calculationsEnabled | Specifies whether calculate scripts will execute. | None |
validationsEnabled | Specifies whether validation scripts will execute. | None |
pageUp | Goes 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. |
pageDown | Moves to the next page of a form. Use the pageDown method at runtime. | |
setFocus | Sets 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. | |
resetdata | Resets 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. |
messageBox | Displays a dialog box on the screen. It is available only for client applications | Message 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
presence
access
name
value
rawValue
formattedValue
formattedValue
through script is not supported.editValue
editValue
through script is not supported.formatMessage
formatMessage
through script is not supported.fillcolor
border
ui
mandatory
borderColor
length
addItem
clearItem
boundItem
execCalculate
execValidate
execEvent
getItemState
setItemState
getDisplayItem
getSaveItem
deleteItem
setItems
Form
InstanceManager
name
occur
min
max
count
setInstances
addInstance
removeInstance
moveInstance
insertInstance
list
length
item
append
remove
insert
node
isContainer
isNull
resolveNode
resolveNodes
model
Subform
submit
tree
- Not supported for xfa.nodes, desc
- Number of nodes reported for PDF and HTML are different.
subformset
content
dataValue
edge
- 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
- 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
- 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
pattern
- 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
- 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
- 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
corner
- 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
choiceList
dateTimeEdit
Image
imageEdit
numericEdit
object
rectangle
textEdit
exclGroup
arc
border
$layout
- 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.
- 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.
- 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.
- 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.
- layout.pageCount() method returns different values for PDF and HTML forms.
- On decreasing page count by hiding an object, abspagecount method returns incorrect value.
- 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
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
var a=3
a=3
- Logic (and/or)
- Comparison (greater/less/ equal)
1 <> 2
A NE B
A or 1
1 <> 2
A NE B
do s = s + i endfor
do s = s + i endfor
Acrobat API Support
-
Arithmetic Functions
- Abs()
- Avg()
- Ceil()
- Count()
- Floor()
- Max()
- Min()
- Mod()
- Round()
- Sum()
-
Scientific Functions
- Acos()
- Asin()
- Atan()
- Atan2()
- Cos()
- Sin()
- Tan()
- Exp()
- Log()
- Pow()
- Sqrt()
- Deg2Rad()
- Rad2Deg()
- Pi()
-
Financial Functions
- Apr()
- Cterm()
- Fv()
- Ipmt()
- Npv()
- Pmt()
- Ppmt()
- Pv()
- Rate()
- Term()
-
Logical Functions
- Choose()
- If()
- Oneof()
- Within()
-
String Functions
- At()
- Concat()
- Left()
- Len()
- Lower()
- Ltrim()
- Replace()
- Right()
- Rtrim()
- Space()
- Stuff()
- Substr()
- Upper()
- WordNum()
-
Date and Time
- Date()
- num2date()
- DateFmt()
Supported XFA events
The following client sided XFA events are supported:
- Initialize
- Validate
- Calculate
- Click
- Enter
- Exit
- Change
- ValidationState