US Postal Codes - formatting

This is a bit specific but does anyone happen to know the form design format string for zip codes in the USA?

The general format is:

Case 1: ##### (e.g. - zip code is 23071) OR,

Case 2: #####-#### (e.g. - zip code is 23071-4538). This is known as a ZIP+4 zip code.

The # indicates a number only (not characters).

The existence of the dash (in case 2) will trigger a “red” field format error if the user fills in a valid but shorter format string (i.e. - Case 1). The problem with Case 2 is that the user "didn’t fill in the ‘required’ 4 last numbers).

Easy enough to hand code out as an exception case but I was hoping to read the formatting string from a database table of countries using standard form “formatting” strings and apply against the form element format property. I realize this is somewhat of a conditional format situation … just wondering if this is possible through format strings.

Thanks, Michael

Not applicable to the format property but you could use the new validation options of Servoy 3.5.

In a method you could read the correct format from the mentioned table and compare it against the entered value.

Thanks, Marcel - I’ll give it a try,

Michael