Auto Format Zip Code In Adaptive Form
I am working on developing Fragments for address and need to capture zip code in that. The requirement is to allow 5 or 9 digit zip code and it should be auto formatted.
I have tried below out of box display patterns for this and not able to fulfill the actual business requirement
text{99999-9999} - Working fine for 9 digit zip code but leaving "-" at the end when user enter 5 digit Zip code.
text{99999}|text{99999-9999} - Giving totally wrong format.
However for validation pattern I have used regular java script regex "^\d{5}(\d{4})?$" and its fitting the bill. I am looking for solution to fix my display pattern problem.
