PDF Editing Issues

Format and Capitalize Canadian Postal Codes in Acrobat Forms

Camila MilosovichCamila Milosovich Nov 19, 2026 868 views

Question details

Set up an Acrobat form field to accept a Canadian postal code in A1A 1A1 format and convert letters to uppercase.

Format and Capitalize Canadian Postal Codes in Acrobat Forms
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the field properties

In Acrobat, open the PDF and select Prepare a form. Double-click the postal code text field to open its properties.

2
Set the mask

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.

3
Add the uppercase script

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.

4
Test the field

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.

Add a postal code mask and capitalization script in Acrobat
Format versus postal validity: The mask checks the character pattern, not whether a postal code is assigned or deliverable. PDF viewers that do not run Acrobat JavaScript may not automatically capitalize the entry.
Free Microsoft Office alternative

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.

Open and work with PDF documents alongside other office filesCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXFamiliar interface for a smoother move from Microsoft OfficeFree, lightweight office suite
microsoft office alternative - wps office

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.