Adobe 12001196 Scripting Guide - Page 69

Validate Tab, Region/Name, See Reference, Example, AFRange_Validate

Page 69 highlights

Using Acrobat JavaScript in Forms 4 Creating form fields programmatically Region/Name See Reference Time AFTime_Format() Special AFSpecial_Format() Custom Example see table notes Table Notes. ● Number: The example in the table corresponds to a comma delimited euro currency with two decimal points in the UI. ● Custom: Any format script that does not use the above mentioned format functions is classified as custom formatting script. Custom keyboard script is set using the setAction with a trigger name of "Keystroke". Validate Tab The action of the combo box can be set with the field level setAction and a trigger name of "Validate". Validation can consist of either verifying that an input value is between given limits, or validation can be performed by a custom script. See Field/Validate for more information. Region/Name Field value is in range Run custom validation script See Reference AFRange_Validate() in Javascripts\aform.js Example f.setAction("Validate", 'AFRange_Validate(true, 0, true, 100)'); /* value between 0 and 100, inclusive */ see table notes Table Notes. ● Custom: Any validate script that does not use the AFRange_Validate() function is classified as custom. Acrobat JavaScript Scripting Guide 69

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90

Acrobat JavaScript Scripting Guide
69
Using Acrobat JavaScript in Forms
Creating form fields programmatically
4
Table Notes.
Number: The example in the table corresponds to a comma delimited euro currency
with two decimal points in the UI.
Custom: Any format script that does not use the above mentioned format functions is
classified as custom formatting script. Custom keyboard script is set using the
setAction
with a trigger name of "Keystroke".
Validate Tab
The action of the combo box can be set with the field level
setAction
and a trigger name
of "Validate". Validation can consist of either verifying that an input value is between given
limits, or validation can be performed by a custom script. See
Field/Validate
for more
information.
Table Notes.
Custom: Any validate script that does not use the
AFRange_Validate()
function is
classified as custom.
Time
AFTime_Format()
Special
AFSpecial_Format()
Custom
see table notes
Region/Name
See Reference
Example
Field value is in range
AFRange_Validate()
in
Javascripts\aform.js
f.setAction("Validate",
'AFRange_Validate(true,
0, true, 100)');
/* value between 0 and
100, inclusive */
Run custom validation
script
see table notes
Region/Name
See Reference
Example