Format and Capitalize Canadian Postal Codes in Acrobat Forms
Question details
Set up an Acrobat form field to accept a Canadian postal code in A1A 1A1 format and convert letters to uppercase.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating or editing a PDF form with a Canadian postal code text field.
- Observed behavior
- The desired field accepts the letter-digit pattern with a space and displays letters in uppercase.
Open the PDF in an Acrobat version that can edit form fields, and make sure the postal code field is a text field. JavaScript must be enabled in the PDF viewer for the capitalization script to run.
Add a postal code mask and capitalization script in Acrobat
Use a field mask for the letter-digit layout and a validation script to uppercase entered letters.
In Acrobat, open the PDF and select Prepare a form. Double-click the postal code text field to open its properties.
On the Format tab, choose Special, select Arbitrary Mask, and enter A9A 9A9. In this mask, A represents a letter and 9 represents a digit.
On the Validate tab, select Run custom validation script, click Edit, and enter: event.value = event.value.toUpperCase(); Save the script and close the field properties.
Use Preview in Prepare a form and enter a postal code with lowercase letters, such as k1a 0b1. Check that it displays as K1A 0B1, then test invalid characters and incomplete entries.

Work with PDFs and Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. It supports common Office formats for an easier transition, but it does not fix Acrobat form settings or guarantee execution of Acrobat validation scripts.

Frequently Asked Questions
What mask should I use for a Canadian postal code in Acrobat?
In the text field properties, go to Format > Special > Arbitrary Mask and enter A9A 9A9. The A positions accept letters and the 9 positions accept digits.
How do I make lowercase postal code letters uppercase?
In the field properties, open Validate, select Run custom validation script, click Edit, and enter event.value = event.value.toUpperCase();.
Why does the postal code stay lowercase in another PDF viewer?
The viewer may have JavaScript disabled or may not support Acrobat form scripts. Enable JavaScript if the viewer offers that setting, or test the form in Acrobat.
Does the mask confirm that a Canadian postal code is real?
No. The mask controls the letter-digit pattern; it does not check whether the postal code is assigned or deliverable. Test actual postal validity against an appropriate postal data source.
How can I check whether the field accepts incomplete entries?
In Acrobat's Prepare a form tool, select Preview and try entering part of a postal code. Also test invalid characters and a complete lowercase entry before distributing the form.




