CodeWithAloha / HIERR

A Human-Centered Digital Engagement Process for the Hawai‘i Economic Recovery & Resilience Project with the State Office of Planning & Sustainable Development
https://hierr.vercel.app/
8 stars 7 forks source link

Add ZipCode validation #25

Closed avenmia closed 1 year ago

avenmia commented 1 year ago

In the ZipCode component, we are passing through whatever text is submitted in the ZipCode box. https://github.com/CodeforHawaii/HIERR/blob/9d611dd1f9e3be7e7d04e324c2977358c627d235/src/components/zipcode.tsx#L14

This issue is to add validation to make sure the user enters a valid ZipCode.

Add a regex to check if the text the user entered is 5 digits.

kmal808 commented 1 year ago

Resource: https://stackoverflow.com/questions/2577236/regex-for-zip-code