Checkpoint 29: Actions
Scripts and actions within PDFs must not require specific timing for individual keystrokes. All interactive functionality must be accessible to users who may need more time to input information or who use alternative input methods.
What This Means
PDFs can contain JavaScript that responds to user input, including keystrokes. PDF/UA requires that these scripts do not depend on the timing between keystrokes. Users must be able to:
- Type at their own pace without time pressure
- Use assistive technology that may input characters differently
- Pause between keystrokes without losing functionality
- Complete input without racing against a timer
Timing-dependent scripts create barriers because:
- Some users type slowly due to motor impairments
- Screen reader users may need time to verify input
- Alternative input methods (voice, switch devices) have different timing
- Cognitive disabilities may require more processing time
The requirement does not prohibit JavaScript or keyboard interaction; it prohibits requiring specific timing patterns for those interactions.
Why It Matters
Timing requirements on keystrokes can exclude many users:
- Motor impairments: Users with limited dexterity may type slowly
- Tremors: Conditions like Parkinson's cause irregular keystroke timing
- One-handed typing: Users may need more time between keys
- Voice input users: Speech recognition has natural pauses
- Switch access users: Single-switch input is inherently slow
- Screen reader users: May pause to hear feedback between keys
- Cognitive disabilities: Processing and responding takes time
Real-world examples of problematic timing requirements:
- Password fields that auto-submit after detecting "complete" input
- Search fields that require typing "fast enough" to be recognized as continuous
- Gaming-style interactions requiring rapid key sequences
- Timeout-based interactions that fail if typing is too slow
These create barriers that prevent users from completing tasks successfully.
Common Violations
The Matterhorn Protocol defines one failure condition for actions.
29-001: Script Requires Specific Timing for Individual Keystrokes (Human Testing)
What's Wrong: JavaScript in the PDF requires users to press keys within a certain time frame, either:
- Minimum time between keystrokes (too fast detection)
- Maximum time between keystrokes (timeout between keys)
- Specific key sequence timing (rhythm-based input)
- Auto-execution based on pause detection
How to Identify:
- Test all interactive JavaScript features in the PDF
- Type very slowly in text fields (5+ seconds between keys)
- Type at varying speeds
- Look for behavior that changes based on typing speed:
- Fields that auto-submit
- Input that is rejected or cleared
- Different results from fast vs. slow typing
- Timeout messages during input
Testing Scenarios:
- Form fields: Type one character, wait 10 seconds, type another
- Search functionality: Enter characters slowly and verify functionality
- Interactive calculations: Input numbers at varying speeds
- Any JavaScript-driven field: Test with significant pauses between keystrokes
Problematic Patterns:
// BAD: Auto-submit after detecting pauselet typingTimer;field.onKeyUp = function() {clearTimeout(typingTimer);typingTimer = setTimeout(submitForm, 500); // Submits after 0.5s pause};// BAD: Ignore input if too slowlet lastKeyTime = Date.now();field.onKeyPress = function() {if (Date.now() - lastKeyTime > 2000) {// Clears or ignores input after 2 second gapthis.value = '';}lastKeyTime = Date.now();};
How to Fix in Adobe Acrobat
Reviewing JavaScript for Timing Dependencies
-
Go to Tools > JavaScript
-
Select Document JavaScripts to view document-level scripts
-
Review code for timing-related functions:
setTimeout()orsetInterval()related to keystrokesDate.now()ornew Date()in keystroke handlersonKeyUp/onKeyDownhandlers with timing logic
-
Check field-level scripts:
- Go to Tools > Prepare Form
- Select each field and view Properties > Actions
- Review any JavaScript actions for timing logic
Removing Timing Dependencies
Auto-submit removal:
Before:
// Submits form after user stops typing for 1 secondvar timer;event.target.addEventListener('keystroke', function() {clearTimeout(timer);timer = setTimeout(function() {this.getField('submit').buttonImportIcon();}, 1000);});
After:
// Submit only when user explicitly clicks Submit button// Remove automatic submission entirely
Timeout removal:
Before:
// Clears field if typing pauses too longvar lastKey = Date.now();if (event.name === 'Keystroke') {if (Date.now() - lastKey > 3000) {event.value = '';}lastKey = Date.now();}
After:
// Simply accept the keystroke without timing checkif (event.name === 'Keystroke') {// Process keystroke normally}
Alternative Interaction Patterns
Instead of timing-based triggers, use explicit user actions:
- Submit buttons: Require explicit click/activation to submit
- Search buttons: Add a "Search" button rather than auto-search
- Confirmation: Ask user to confirm when ready
- Clear buttons: Let users explicitly clear if needed
Testing Modified Scripts
- Make JavaScript changes
- Save the PDF
- Test all interactive features:
- Type very slowly (10+ seconds between keys)
- Type at normal speed
- Type very quickly
- Verify consistent behavior regardless of speed
How to Prevent in Source Documents
Avoiding Timing-Dependent Scripts
When creating PDFs with JavaScript:
- Design for explicit actions: Users click/tap to confirm
- Avoid auto-behaviors: Do not auto-submit, auto-clear, auto-advance
- Test with slow input: Verify scripts work at any speed
- Consider assistive technology: Input may come in unexpected patterns
Alternative Approaches to Common Features
Instead of auto-search:
// Provide search buttonvar searchBtn = this.getField('searchButton');searchBtn.setAction('MouseUp', 'performSearch()');
Instead of input timeout:
// Let users work at their own pace// Only validate when they explicitly request validationvar validateBtn = this.getField('validateButton');validateBtn.setAction('MouseUp', 'validateInput()');
Instead of detecting "complete" input:
// Use a "Done" or "Next" buttonvar doneBtn = this.getField('doneButton');doneBtn.setAction('MouseUp', 'processInput()');
Form Design Best Practices
- Explicit submission: Always use submit buttons
- Save capability: Allow saving work in progress
- No time limits: Never require completion within a time frame
- Progress indicators: Show completion status without time pressure
- Error tolerance: Allow correction without starting over
Testing Your Fix
Manual Timing Tests
-
Slow typing test:
- Open the PDF
- Navigate to any text input field
- Type one character
- Wait 30 seconds
- Type another character
- Verify the field still works correctly
-
Variable speed test:
- Type some characters quickly
- Pause for 10 seconds
- Type more characters
- Verify consistent behavior
-
Very slow completion:
- Take 5 minutes to complete a form
- Verify nothing times out or resets
Assistive Technology Testing
-
Screen reader test:
- Use NVDA, JAWS, or VoiceOver
- Navigate to form fields
- Input characters while listening to feedback
- Verify timing does not affect functionality
-
Voice input test:
- Use voice recognition software
- Dictate text to form fields
- Natural pauses in speech should not cause issues
-
Switch/scanning input:
- If possible, test with switch access
- Single-switch input has inherent delays
- Verify functionality with slow input
JavaScript Review
-
Search JavaScript code for timing indicators:
setTimeoutsetIntervalDate.now()new Date()performance.now()
-
For each timing function found:
- Determine if it relates to keystroke handling
- Verify it does not create timing requirements for users
- Consider if it is necessary or can be removed
Validation Checklist
- All form fields accept input at any speed
- No auto-submit based on pause detection
- No input timeout that clears or rejects data
- No keystroke sequence timing requirements
- Explicit buttons for submission and actions
- JavaScript reviewed for timing dependencies
- Tested with very slow input (30+ second gaps)
- Tested with screen reader
- Consistent behavior regardless of input timing
Acceptable vs. Problematic Timing
Acceptable Use of Timing
Some timing-related features are acceptable:
- Debouncing for performance: Waiting briefly before processing to reduce server calls, as long as no input is lost or rejected
- Animation timing: Visual effects that do not affect functionality
- Session timeout warnings: With adequate time and user notification
- Auto-save: Periodically saving work (does not require specific keystroke timing)
Problematic Timing
These patterns violate accessibility requirements:
- Keystroke timeout: Rejecting or clearing input based on typing speed
- Auto-submit on pause: Submitting when typing stops
- Sequence timing: Requiring specific rhythm in key presses
- Typing speed validation: Treating slow typing as suspicious
- Real-time validation timeout: Requiring immediate re-typing
Edge Cases
Consider carefully:
- CAPTCHA alternatives: Timing-based bot detection may need accessible alternatives
- Security features: Multi-factor authentication should allow adequate time
- Gaming elements: Interactive games may need accessibility modes
Related Considerations
WCAG 2.1.1: Keyboard
All functionality must be keyboard accessible. Timing requirements often compound keyboard accessibility issues by adding time pressure to keyboard navigation.
WCAG 2.5.1: Pointer Gestures
While this criterion focuses on pointer input, the underlying principle applies: do not require specific physical capabilities (including speed) for interaction.
Form Timeout Extensions
If your PDF form connects to a backend system with timeouts:
- Warn users before timeout
- Provide easy way to extend time
- Save user data before timeout
- Allow session restoration after timeout
Additional Resources
Official Standards and Guidelines
- W3C WCAG 2.1 Success Criterion 2.1.1: Keyboard
- W3C WCAG 2.1 Success Criterion 2.5.1: Pointer Gestures
- PDF Association Matterhorn Protocol 1.02
JavaScript and Accessibility
Input Methods and Assistive Technology
Tools
- PAC (PDF Accessibility Checker) - Free PDF/UA validation
- NVDA Screen Reader - Free screen reader for testing
- Acrobat JavaScript Debugger
This documentation is based on the Matterhorn Protocol 1.02, the definitive reference for PDF/UA validation. Actions/timing violations require human testing because automated tools cannot determine if JavaScript creates keystroke timing dependencies. For the most current information, consult the PDF Association and W3C WCAG guidelines.