Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

How do I allow multiple formats in a required field?

Avatar

Former Community Member

Hi,   

In this case I am trying to validate a zip code field to allow U.S., Canada, and UK zip codes.  How would I do this?  I tried using the attached image, but it gives me an error when I enter a nine-digit U.S. zip code, like 12345-6789.  I want the field to be able to accept the four different zip code formats below.  Thank you for your help.

es3zipcodevalidation.JPG

1 Accepted Solution

Avatar

Correct answer by
Level 10

I've never tried doing that many different types in one go but I Just tried it and it seems to work.

All the stuff you have in the Validation field should also be in the Edit and Display tabs. The Validate patterns validate to the Display patterns (if the data displays properly then it will validate). The Edit pattern controls the different ways data can be entered.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

I've never tried doing that many different types in one go but I Just tried it and it seems to work.

All the stuff you have in the Validation field should also be in the Edit and Display tabs. The Validate patterns validate to the Display patterns (if the data displays properly then it will validate). The Edit pattern controls the different ways data can be entered.

Avatar

Former Community Member

Worked like a charm.  Thank you!