0

My DynamicForm field has 2 validators for zip code

[
    { type: "mask", errorMessage: "Invalid postal code", mask: "^(\\s*\\d{5}\\s*)(\\s*-?\\s*\\d{4}\\s*)?$", transformTo: "$1-$2" },
    { type: "mask", errorMessage: "Invalid postal code", mask: "^\\s*([A-Z]{1}\\d{1}[A-Z]{1})\\s*(\\d{1}[A-Z]{1}\\d{1})\\s*$", transformTo: "$1-$2" }
]

The first is for the United States, the 2nd is for Canada. Is It possible to set the field up to accept either option as valid input?

stackoverfloweth
  • 6,669
  • 5
  • 38
  • 69

1 Answers1

1

this answer is a bit old but I think it's still valid.

claudiobosticco
  • 413
  • 2
  • 8