Validate Zip Code Input

If you are collecting US Zip Code in Digioh forms, you may want to enforce input validation that it is a 5 digit number.

This can be done with Digioh Extension: US zip code validation. To add this app to your account, follow these steps:

1)  Click on your Profile name (top-right) > Extensions.

2) Expand the Data Validation category & select the Install button for our US Zip Code Validation extension: 

Digioh's Extensions manager under the Data Validation category, with a red box highlighting the 'US zip code validation' extension and its Install button.

Then, you can configure validation for the specific custom field you are using for Zip:

Digioh's campaign editor displaying a red arrow connecting the selected Zip Code input field to its Field Metadata section, highlighting key-value pairs for 'zip_validate' set to 'true' and 'zip_validate_error' set to 'custom error message', along with a red box around the fallback Custom Error Text field.

This app works in addition to Digioh native validation. The app will honor the field "Required" setting and not try to validate an empty field, and if you enter something for "Error Text" (in green) then the app will use that.

If you want a different error message for required, e.g. "Zip Code is Required", vs. invalid e.g. "Please enter a valid US zip code.", then you can also configure metadata zip_validate_error.


  • zip_validate=true: enable the extension for this field
  • zip_validate_error=error text: show this error on validation failure
  • Native Error Text (Custom Error Text box): app will use this error if no zip_validate_error metadata is configured
  • "Please enter a valid US zip code.": default error if neither Error Text or zip_validate_error is configured''

Any non-empty value activates validation

The zip_validate key is evaluated for presence, not for a specific value. Any non-empty string — including "false" — activates zip validation. To disable validation on a field, remove the zip_validate metadata attribute entirely.

Metadata reference

Metadata Key

Level

Value

Description

zip_validate

ElementtrueActivates zip code validation on this text input field.

zip_validate_error

ElementYour messageCustom error message shown when validation fails. Overrides the field's Error Text setting and the default message.


Want to get more from Digioh?

Get the playbooks leading brands use to convert more visitors into revenue.

Browse the Playbooks ?

Platform Tour

See what else you can do with Digioh in our self-guided platform tour.

Take the Tour ?

Still Need Help?

Connect with our team for technical help.

Message Support