ZIP CODE LOOKUP TOOL

By: chris lynch | Asked: 11/20/2022
ForumsCategory: How-toZIP CODE LOOKUP TOOL
chris lynch asked 2 years ago
I HAVE A PEST CONTROL COMPANY AND I WANT TO HAVE A SECTION ON MY WEBSITE WHERE POTENTIAL CUSTOMERS CAN ENTER THERE ZIP CODE AND IT WILL SAY IF I SERVICE THERE AREA. HOW DO I GO ABOUT DOING THIS
Rob LeVineRob LeVine replied 2 years ago

How do you know on your end if the zip code is within your service area? Do you have a list of zipcodes you serve or do you have a list of town/city names or what?

chris lynch replied 2 years ago

yes I do Have a list of zip codes

3 Answers
Bobby Clapp answered 2 years ago
In a table, yes. In a map, probably custom code. Do you have a table (excel or similar) of the area codes and whether they are serviceable or not?
chris lynch replied 2 years ago

yes I do have all the zip codes in a list that I could put it in any format that is needed

Bobby Clapp replied 2 years ago

So does this list have like 90210 = yes, 90645 = no or how is it determined that the zip code is a serviceable area?

Rob LeVineRob LeVine answered 2 years ago
Maybe Bobby has a better idea, however, my thought is to use jQuery/Ajax to pass the zipcode to a PHP program that will return true or false based on whether the value is in your list.  The jQuery/Ajax is about 10 lines +/- and the PHP is about the same, depending a little on whether your list is fixed or whether it's stored in a table (form).
Rob LeVineRob LeVine replied 2 years ago

A further thought. If you have a fixed list of zip codes that aren't in a table, i.e., they're just a list you keep manually, then you could do the whole thing in a 5-line jQuery program. Just check if the entered value is in the list and you're done.

Sam Parker answered 1 year ago
I know this post is a little dated kindly let me know if this should be a new thread.  Essentially the same question; I provide at home automotive services and want to do the same 'service area validation by zip code'. 

I created a form and uploaded the list of Zip Codes that are in my service area. Couldn't this "Validation" happen using conditional logic?  Something like this: Create a form with a lookup field and if the entered zip code matches one on the linked form-field, go here. If not, go there?  If so could someone help with an example?
Walter JonesWalter Jones replied 1 year ago

You are on the right track. I would do a single line number field (set it as a lookup) that watches the zipcodes that you allow. Then create the logic to show the remainder for the form if it finds a zip code you allow. Should be pretty straight forward.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right