Zip Code validation

Saturday, April 20, 2024 4:02:14 PM
  • Posted: Monday, June 15, 2020 6:33 AM
  • 14
Hi Patryk,

I have a requirement to validate a user based on his Shipping address zip code.
I just need to validate his zipcode and say weather are we serving the specified location or not.
If we are not serving that location I need to stop the customer for further proceeding.
0
  • Posted: Monday, June 15, 2020 6:58 AM
  • 953
Hi,

Please look at the Roslyn scripts in GrandNode. One of our example has been written to validate the zip code. By default, we've added possibility to validate the Polish zip code, so you would need to make a customization. You can find it here: https://github.com/grandnode/grandnode/blob/develop/Grand.Web/Roslyn/ZipCodeValidation.csx

If you want to use Roslyn scripts, you need to activate them in appsettings.json file, just edit your appsettings.json file and on #90 line change the value of settings to True.

Restart your app and that's all.

Cheers!
Best regards,
Patryk

GrandNode Team
0
  • Posted: Monday, June 15, 2020 8:50 AM
  • 14
Hi,
But can I Validate the zip code across the list of Zipcodes

Example : Zipcodes: 534002,534003

if the entered zip code is not available from the above list I need to show him a message
Is this possible?

Note: I need to save the list of zipcodes in Database and validate the entered zip code among them
0
  • Posted: Monday, June 15, 2020 11:32 AM
  • 953
Sure it's possible, however, it requires customization. Out of the box, you are not able to do it.
Best regards,
Patryk

GrandNode Team
0
back to top
Filters