You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Officers UI: Update Officer address postal code validation #31200
When you go to an officer change and enter a postal code
If you do not type the postal code in the correct format or sequence (A1A 1A1) then the input field does not show the character you have typed. For instance if I type the number 3 first, it won't show up. I must type a letter first. The problem with this is that we aren't telling the user what the issue is and we aren't indicating the correct format for them to follow.
Also I can save the form with an incorrect postal code. For instance if I enter V3W 2 the officer form will save and I can actually submit the filing.
When I type unacceptable characters into the postal code field, the "Enter a valid postal code" error message displays on blur.
When I try to submit, the postal code field displays the error message "This field is required"
Notes
This is an update to existing requirements - enforcing a postal code format was not required during initial implementation because we were following the director's pattern. We have recently changed postal code validation on firms and we would like to update this pattern to match that pattern update.
changed the title [-]Officer address postal code validation is not working properly[/-][+]BUG: Officer address postal code validation is not working properly[/+]on Nov 7, 2025
changed the title [-]BUG: Officer address postal code validation is not working properly[/-][+]Officer Change UI Officer address postal code validation is not working properly[/+]on Nov 7, 2025
changed the title [-]Officer Change UI Officer address postal code validation is not working properly[/-][+]Officer Change UI: Officer address postal code validation is not working properly[/+]on Nov 7, 2025
PS Here is the Postal Code form component, which uses masking to enforce the format. A different mechanism will be needed if we want different validation behaviour. I don't know if someone at bcgov has already invented a better Postal Code input component...
changed the title [-]Officer Change UI: Officer address postal code validation is not working properly[/-][+]Officer Change UI: Update Officer address postal code validation [/+]on Nov 13, 2025
@deetz99
If work hasn't started on this yet can we switch back to using only one error message?
So if they enter the incorrect format or an invalid character, display "Enter a valid postal code" in both scenarios.
Thanks @severinbeauvais, yes we should probably allow for an optional space so we don't break paste behavior, but after the data is saved it would be nice if it reads as A1A 1A1 on the output documents so all addresses have a consistent format. It would be great if we could also convert the alpha characters to be capitalized after the postal code is saved.
@deetz99 Sorry for the confusion. I don't want to conflict with established patterns, but I believe this came up because we were getting alot of calls and problems with users putting in the wrong format - specifically that people would put a zero when they meant a letter O and vice versa. So I think the format hint is important here.
But now that most of the designers and design leads are back online I can get some input from them and if they have any concerns about the approach, I can put it into another ticket since this has been implemented already and let the PO decide how it gets prioritized if that sounds good you.
Activity
[-]Officer address postal code validation is not working properly[/-][+]BUG: Officer address postal code validation is not working properly[/+][-]BUG: Officer address postal code validation is not working properly[/-][+]Officer Change UI Officer address postal code validation is not working properly[/+][-]Officer Change UI Officer address postal code validation is not working properly[/-][+]Officer Change UI: Officer address postal code validation is not working properly[/+]severinbeauvais commentedon Nov 12, 2025
@JohnamLane @deetz99 @OlgaPotiagalova Should Entities be maintaining this UI now, or does Dietrich have the ability to help?
PS Here is the Postal Code form component, which uses masking to enforce the format. A different mechanism will be needed if we want different validation behaviour. I don't know if someone at bcgov has already invented a better Postal Code input component...
https://github.com/bcgov/business-ui/blob/main/web/person-roles/app/components/Form/Address/PostalCode.vue
[-]Officer Change UI: Officer address postal code validation is not working properly[/-][+]Officer Change UI: Update Officer address postal code validation [/+]19 remaining items
severinbeauvais commentedon Dec 19, 2025
FWIW, while working on #31312, it was decided that we would accept postal codes with or without the space.
deetz99 commentedon Dec 20, 2025
@severinbeauvais It should be consistent though shouldn't it? It will also simplify the display since it will be in the correct format already
deetz99 commentedon Dec 20, 2025
@jacqueline-williams-549
Sounds good to me, I will make those updates.
As discussed in the other ticket, the realtime updates won't be displayed until the input has had a blur event.
severinbeauvais commentedon Dec 22, 2025
The regex that both UIs are using handles the optional space, I believe.
I'll leave it to our UX team to ensure consistency, since I know we're using different underlying technology.
jacqueline-williams-549 commentedon Dec 23, 2025
@deetz99
If work hasn't started on this yet can we switch back to using only one error message?
So if they enter the incorrect format or an invalid character, display "Enter a valid postal code" in both scenarios.
Thanks @severinbeauvais, yes we should probably allow for an optional space so we don't break paste behavior, but after the data is saved it would be nice if it reads as A1A 1A1 on the output documents so all addresses have a consistent format. It would be great if we could also convert the alpha characters to be capitalized after the postal code is saved.
deetz99 commentedon Jan 5, 2026
@jacqueline-williams-549
This has been done already, do you not want a format hint in the error message?
jacqueline-williams-549 commentedon Jan 6, 2026
@deetz99 Sorry for the confusion. I don't want to conflict with established patterns, but I believe this came up because we were getting alot of calls and problems with users putting in the wrong format - specifically that people would put a zero when they meant a letter O and vice versa. So I think the format hint is important here.
But now that most of the designers and design leads are back online I can get some input from them and if they have any concerns about the approach, I can put it into another ticket since this has been implemented already and let the PO decide how it gets prioritized if that sounds good you.
deetz99 commentedon Jan 7, 2026
@jacqueline-williams-549
Works for me
chdivyareddy commentedon Feb 9, 2026
Verified in DEV!