I’m scheduled to be part of a group doing a preconference hands-on lab on October 2 at MAX. Details here. It would be great to see some of you at that session. Or if not that session, then at some other point during MAX.
I continue to be interested in the challenges of developing forms that give a good experience for visually impaired users using screen readers. Previously we have focussed on checking accessibility properties at design time. However, analysing the form design template doesn’t always fit the user workflow. There are cases where accessibility properties are populated at runtime by script or by data binding. In this case, these properties are un-populated in the design version and consequently, the design-time accessibility checker will give warnings — yet at runtime the accessibility experience may be just fine.
In addition, we want to make sure that the accessibility experience adapts to changes in dynamic forms. We need to be able to test accessibility in various states — e.g. after subforms are added or removed.
The obvious answer is to perform accessibility checking at runtime — while the form is open in Reader or Acrobat. Today we’ll look at a solution to that problem. A mechanism for instrumenting your forms to allow you to analyse the state of accessibility information at runtime.
For those of you who want to use the solution without necessarily understanding how it works, follow these steps:
- Drag this fragment anywhere onto your form. It will add a hidden subform with no fields (just script)
- With the form open in Reader/Acrobat, paste the value “AccCheck” into any field on the form
- From the resulting dialog, select which accessibility checks to run
- Copy the results from the report dialog for future reference
- All elements with accessibility issues will be re-drawn with a 2pt red border. If the element is a field or draw, it will also be shaded light red and the accessibility error text will be assigned to the tooltip.
- Close your form and go back to Designer to fix any identified issues
Try it out with this sample form. Note that this form dynamically populates some properties. The Designer-based accessibility checker will report twice the number of errors.
Hopefully the embedded checker is innocuous enough that you could leave it in a production form. But if not, you should be able to inject it during your testing phase and remove it when you’re ready to deploy your form.
The Deep End
For those who want to know how this works…
The challenge is to add something to your form without introducing an observer effect – i.e. analytics that can run without changes to your form UI and without impacting normal form processing.
The runtime accessibility checker is designed as a form fragment that you can drag onto any form. The fragment is a single, hidden subform with no fields, no data binding — just script.
We want to trigger the analysis script without requiring the user add a “check accessibility” button to their form. In this case, I added a propagating change event to the fragment subform. This script checks the xfa.event.change event property. If the change text is equal to “AccCheck”, we launch the accessibility checker.