ZipCode Data Type


I am wondering if the correct data type for the ZipCode attribute should be text, especially because of the different countries/cities within the data model (the symbol "-" might exist in several countries).

The main concern if to prevent incorrect data records from the end-user, but then the text data type would allow text itself...

What would you advise regarding this?



Some countries use letters. Some as a prefix for the state/district, others even as a full name. 

Unless your site is for a single country (internal portals of non-international companies) I'd stick with text and do the validations server-side before saving.

How to do that server side validation? 

Thanks Nuno!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.