Title: Not validating zip code
Last modified: August 21, 2016

---

# Not validating zip code

 *  Resolved [writecraft](https://wordpress.org/support/users/writecraft/)
 * (@writecraft)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/not-validating-zip-code/)
 * Hi, your plugin is not validating WA zip codes on my sites — see sobaymaps.com&
   englishonaroll.com. WP 3.6, WA SST 1.1.0. It looks like the zip-required.js script
   is not getting enqueued properly. Can you help?
 * [http://wordpress.org/plugins/washington-state-sales-tax-for-shopp/](http://wordpress.org/plugins/washington-state-sales-tax-for-shopp/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [writecraft](https://wordpress.org/support/users/writecraft/)
 * (@writecraft)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/not-validating-zip-code/#post-4050076)
 * Been doing some fiddling around and think I’ve found a solution. Turns out your
   postal code validation required ‘Tax Downloads’ to be enabled, and then it removed
   the ability to select a country to ship to. So, in washington-state-sales-tax-
   for-shopp.php at line 54 after ‘//update hook’ I added :
 * `add_action( 'wp_enqueue_scripts', array( &$this, 'force_zip_tax_script' ) );`
 * Then modified zip-required.js as so:
 *     ```
       checkZip = function ($toCheckout) {
       		var $validZip = /^\d{5}(-\d{4})?$/;
       		var $shipZip = $('#shipping-postcode').val();
       		var $shipCountry =$('#shipping-country').val();
   
       		if ($shipCountry=='US') {
       				if (!$validZip.test($shipZip)) { ....
       ```
   
 * This seems to work well for me — you might want to consider it for future updates.
 * Thanks!
 *  Thread Starter [writecraft](https://wordpress.org/support/users/writecraft/)
 * (@writecraft)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/not-validating-zip-code/#post-4050077)
 * PS — you might want to allow country selection for downloads as well.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Not validating zip code’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/washington-state-sales-tax-for-shopp_eef7fb.
   svg)
 * [Washington State Sales Tax for Shopp](https://wordpress.org/plugins/washington-state-sales-tax-for-shopp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/washington-state-sales-tax-for-shopp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/washington-state-sales-tax-for-shopp/)
 * [Active Topics](https://wordpress.org/support/plugin/washington-state-sales-tax-for-shopp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/washington-state-sales-tax-for-shopp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/washington-state-sales-tax-for-shopp/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [writecraft](https://wordpress.org/support/users/writecraft/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/not-validating-zip-code/#post-4050077)
 * Status: resolved