Adding ZIP code validation to my Wix store

Hey,
Been working with Wix for sometime, I am not so good with corvid, just wanted help with this particular problem:
I have a store, on the products page, I want to add an input field that allows a visitor to check if we deliver in their area validating their ZIP code from our database.
I just want to give a message on the products page itself if the visitor’s ZIP is not on our delieverable zones, the customer can still place an order that we can manually reject.

I have been looking for this for long, any help would be great. Thank you :slight_smile:

2 Likes

Enable “Add pattern validation” for your input field, and then, as shown in the image below, add the regex pattern: [1]{5}(?:-[0-9]{4})?$


  1. 0-9 ↩︎

Thanks for the quick response. Not very useful though, this is a pattern validation. What I want is to check if a ZIP code entered by the user exists on my database of deliverable ZIP codes, I need a code for that I guess

@netpandllp

Why not just try searching the forum…
https://www.wix.com/corvid/forum/community-discussion/postal-code-check-in-the-database

You can set your Wix Stores shipping by regions already.
https://support.wix.com/en/article/setting-up-shipping-rules-for-specific-regions-or-states

Also, for post code verification, vote for the request here.
https://support.wix.com/en/article/request-verifying-shipping-addresses-in-wix-stores

@netpandllp Ah, sorry. I started working on checking for specific zip codes and then got distracted. Yeh, you’ll need some code for that. You can compare the zip code to a “hard-coded” list of zips, or keep a list in a collection and check against the collection.

@yisrael-wix
Distracted by something in a glass perhaps :wink:

@yisrael-wix Basically,
I want the user to put something in #input1, and press #button1, if the exact same input as in input1 exists in the field ‘abc’ of dataset1 of a collection ‘newcollection’ I want the page to display text1 else (in case the exact match doesn’t exist anywhere in the dataset field) text2.

Please also include the code for hiding text1 and text2 on load, for this noob :slight_smile:

Thanks!

Hi,
How i will add delivery area in my online store site. i checked delivery areas option is available only for rastaurant site. please help me can i add delivery area option in dashboard ? Please help !

Can we modify advanced setting here. Order setting"delivery" can not see in my dashboard. please help !

This forum is dedicated to Corvid. For questions that are not related to code you can contact the Wix support team . You’ll get better help for your problem there.