Take your PDF forms to the next level! In this book, you’ll learn various ways to further improve your PDF forms using simple JavaScript coding. You’ll also discover how a few lines of code can speed up your workflow when working with multiple PDFs in Action Wizard. Enhancing Adobe Acrobat Forms with JavaScript covers up-to-date, real working examples that you can easily download and practice with and edit to suit your own projects. This book also shows workarounds and solutions to various form issues you might encounter. Feel empowered by it and improve your PDF documents! JavaScript has been a part of Adobe Acrobat for many versions. However, few people use its features and focus mainly on using basic form properties, never delving deeper into Acrobat’s full capabilities. While information on the web can be helpful, if you don’t know enough about how to use JavaScript in Acrobat you will be left with poor results. JavaScript can be difficult to learn, but it does not need to be scary. This book explains in simple steps for beginner to intermediate level so that you can take full advantage of Acrobat’s capabilities for your own projects. What You Will Learn • Learn simplified field notation and basic JavaScript for Acrobat • Work with buttons that can be used for navigation • Improve form navigation and printing of forms • Add various types of alerts and custom validations to improve client-entered-data • Learn the basics of how to prepare a form for e-signing Who Is This Book ForThis book is for anyone who needs to create forms for clients or websites. Students, lawyers, accountants, and human resources will be able to take their work to the next level by streamlining their workflow and utilizing advanced JavaScript features in Adobe Acrobat.
Author(s): Jennifer Harder
Edition: 2
Publisher: Apress
Year: 2023
Language: English
Pages: 790
Table of Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Part I: Basic Form Improvements
Chapter 1: A Fundamental Forms Primer
Forms Review
Fields Refresher
Properties Refresher
Text Box Field Properties and Date Field Properties Dialog Boxes
Dropdown Properties Dialog Box
List Box Properties Dialog Box
Check Box Properties Dialog Box
Radio Button Properties Dialog Box
Button Properties and Image Properties Dialog Box
Digital Signature Properties Dialog Box
Barcode Properties Dialog Box
Tabs Refresher
Editing Your Form with the More Menu and Right Pane
Setting the Field Tab Order Using the Menu Options
Clearing a Form While Working
Summary
Chapter 2: Introduction to Actions
Getting Started
Rating Forms Value Averaging and Sum: Working with Text Fields
The Validate Tab
The Calculate Tab for the Grand Total Using Sum
Sum and Averaging Using Check Boxes or Radio Buttons with Text Fields
Using Radio Buttons on Page 3 of the Project
Using Check Boxes on Page 3 of the Project
Turning Check Boxes into Radio Buttons
Basic Action Button Triggers for Reset Buttons and Printing Buttons
Reset Button
Print Form Button
Summary
Chapter 3: Creating a QR Code Custom Stamp
Customizing Your QR Code Stamp
QR Code Creation
Using the Stamp Tool
Final Thoughts: QR Code for Professional Printing
Summary
Chapter 4: Buttons, Navigation, Form, and Nonform Actions
Creating a Button Icon
Example of a Button as a Label Only
Example of a Button Combination of Icon Only
Nonform Properties Actions
Pages
Bookmarks
Web and Custom Hyperlinks
Rich Media Nonform Navigation Buttons
Layers Basic Actions
Other Nonform Actions That Can Affect Sticky Note or Markup Tools Indirectly
Triggers for Actions
Choose an Action That Requires No Code
Newsletter Navigation with Buttons
Form Navigation with a Button as a Helpful Hint
Adding a Comb of Characters
Before Comb and After Comb
More Action Triggers to Show and Hide
Hide and Clear Fields Button
Set Layer Visibility
Using Bookmarks
Using Buttons
Summary
Part II: Simplified Field Notation and Basic JavaScript
Chapter 5: Introduction to Simplified Field Notation and JavaScript
Getting Started
Text Field, Date, and Drop-Down List Properties
Actions Tab
Format Tab
Validate Tab
Calculate Tab
Check Box, Radio Button, Image Field, and Button Properties
List Box Properties
Digital Signature Properties
Barcode Properties
Global Document JavaScript
Web Links and References
Regular Forms vs. E-Signature Forms
JavaScript and Acrobat on the Document Level
Summary
Chapter 6: Basic and Complex Calculations
Getting Started
Sum Value
Simplified Field Notation
JavaScript Custom Calculation Script
Final Thoughts on Working with the Calculate Tab
JavaScript Script Validation for Displaying Zero
The Final Line of Code
Drop-Down Alternatives
Set Field Calculation Order
Resetting Your Field of Focus
Summary
Chapter 7: Format Calculations
Number Formatting
Formatting with a Percentage
A Workaround for the Percentage
Reset Fields with JavaScript
Date Formatting
Date Formatting with JavaScript
Time Formatting
Time Formatting with JavaScript, a Custom Example
Comb of Characters for Dates
Special Formatting
Final Thoughts
Drop-Down Alternatives
More Information on Adding Decimal Places and Leading Zeros
Summary
Chapter 8: Various JavaScript Alerts, Notes, and Time Stamps
Alert Types
Create a Document JavaScript
Viewer Version and Validation Alert
Document Actions
Document Will Close
Document Will Print
Alerts Working with Buttons
Adding a Comment Note, Signature, and Time Stamp
Signature Field and Time Stamp
Summary
Chapter 9: Create Help for Clients with Rollover Text and Alerts
The Rollover Method
Mouse Enter
Mouse Exit
Longer Array Example (Optional)
Extra Noncustom JavaScript Check Box Example
How to Show and Hide Fields with JavaScript
The Default Text Method
The Alert Method
Customer’s Full Name
Date
Customer Order Code
Customer’s Company Name
How to Duplicate Text for Multiple Fields and Make Fields Read-Only
Set Fields to Read-Only with JavaScript
Final Thoughts
Summary
Chapter 10: Various Types of Formatting with JavaScript
Adding Global Formatting to Text Fields
Color Properties
Array and Variable Examples of Formatting Properties
Multiline Buttons
Multiline Text
Complex Formatting Using Check Boxes and a Text Field
Rich Text Formatting for Text Fields and Comments
Comment Example
Final Thoughts on Formatting with Text
Silent Printing
Options for Submit Button Using Email
Summary
Part III: Working with More Complex Forms
Chapter 11: Validation with Text Boxes, Alerts, and Radio Buttons
Money Transfer Example
Alternate Way to Work with Radio Buttons Without Alerts
Changing the Shipping Price Using Radio Buttons
Additional Radio Button Example with JavaScript and Text Fields and How to Change Data for Time
Setting Up the Text Fields
Check Box Variation with Date Text Fields
Notes on Changing Formatting Options for Radio Button, Check Box, and Button Style
Formatting for Buttons and How the Following Properties Can Be Affected
Formatting for Radio Buttons and Check Boxes
Text Field Validation with Regular Expressions
Telephone Validation
Name Validation
Account Number Validation
Email and URL Validation
Another Phone and Date Example with Two Variables
Final Thoughts on Formatting Fields
Summary
Chapter 12: Working with Dropdown Lists
Current Skills Request Form
Parts Order Form
Drop-Down Lists with Select Dates and Discounts
Final Thoughts
Load a Lengthy Single Drop-Down or List Menu
Tips on Changing Custom Formatting for Drop-Down Lists with JavaScript
Summary
Chapter 13: Working with List Boxes
List Box Priority List with Control Buttons
The Add Button
The Delete Button
The Clear or Reset Button
The Up Button
The Down Button
Check Box, Drop-Down, and List Box: Example 1
Check Box, List Box, and Multi-Drop-Down: Example 2
Button Slide Show Variation
Extra Example Priority List Improved
Final Thoughts
Hidden Fields
Using List Boxes for a Number Rating
Notes on Changing Custom Formatting for List Boxes
Summary
Chapter 14: Advanced Navigation: The Pop-Up Menu
The Pop-Up Menu Example
Add a Pop-Up Menu Using a Bookmark
Final Thoughts
Summary
Part IV: Beyond the Basics
Chapter 15: Action Wizard and JavaScript
Working with the Action Wizard
Reuse JavaScript from Chapter 8
Is It a Custom Action or a Custom Command?
Create and Manage Custom Commands
Summary
Chapter 16: Multistate Check Boxes
The Problem of Multistate Check Boxes
Bonus Star Rating Idea
Select All or Deselect All Check Boxes at Once
Summary
Chapter 17: Importing an Image into a Button
Creating the Button
Summary
Chapter 18: Multiple Formatting
The Problem of Multiple Formatting
Option 1: Do It Yourself
Price Script
No Price Script
Adding a Degree Symbol and Formatting Range
Option 2: Contact a Professional
Summary
Chapter 19: Digital Signatures and Barcodes
Digital Signatures and Security
Working with Digital Signatures and Other Adobe Security Tools
Signature Field Formatting
Create a Security Puzzle
Barcodes
Summary
Chapter 20: What Are E-Signature Forms and Web Forms?
A Brief Look at Request E-Signatures and Resources
What Are Web Forms?
Summary
Part V: Putting It into Practice
Chapter 21: Homework Assignments
Homework Assignment 1: Show and Hide
Homework Assignment 2: Working with JavaScript to Create Formulas
Area of a Circle A = π r 2
Field: CircumferenceRow1 Circumference of a Circle C = 2 π r
Field: VolumeRow1 Volume of a Sphere V = 4/3 π r3
Field: FahrenheitRow1 Celsius to Fahrenheit to Formula. (°C x 9/5) + 32 = °F.
Field: CelsiusRow1_2 Fahrenheit to Celsius Formula. (°F - 32) x 5/9 = °C
Homework Assignment 3: Custom Validation and Regular Expressions
Homework Assignment 4: Personal Drop-Down List Menu and Definitions Text Box
Summary
Index