Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Validate Canadian Postal Code

Featured Replies

Howdy,

I would like to ensure users type in a valid Canadian postal code into a field. They are formatted like this: A9A 9A9

(Alpha-Number-Alpha-Space-Number-Alpha-Number)

e.g. M5N 2E8

Can anyone point me in the right direction? I don't want to break it into a million separate fields.

Thanks & Regards, Kay

PS Using v4 on MAC

Position( "ABCDEFGHIJKLMNOPQRSTUVWXYZ", Left( postal code, 1 ), 1, 1 )

and

Position( "0123456789", Middle( postal code, 2, 1 ), 1, 1 )

and

Position( "ABCDEFGHIJKLMNOPQRSTUVWXYZ", Middle( postal code, 3, 1 ), 1, 1 )

and

Middle( postal code, 4, 1 ) = " "

and

Position( "0123456789", Middle( postal code, 5, 1 ), 1, 1 )

and

Position( "ABCDEFGHIJKLMNOPQRSTUVWXYZ", Middle( postal code, 6, 1 ), 1, 1 )

and

Position( "0123456789", Right( postal code, 1 ), 1, 1 )

This calculation will return 1 if the postal code conforms to Canadian standards and 0 if it doesn't

Chuck

  • Author

Thank you, thank you! It works great. Kay.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.