When entering data, if the user enters “US” as the country, I want to format the postal_code field like “12345” or “12345-1234”. If the country is “CA” I want to format the postal_code field to look like “A1A 1A3”. In both case, I intend to store the value in the database as “12345”, 123451234" or “A1A1A3”. In the “grid mask” field I can use '99999,99999-9999" or “a9a 9a9” but not “99999;99999-9999;a9a 9a9”. How can I use a conditional mask?
This is how I got it working… xxxxx-xxxx;x x*x;xxxxx. Now to figure out validation of us vs Canada zip / postal codes.