Skip to content

Instantly share code, notes, and snippets.

@caovillanueva
Created November 22, 2022 19:27
Show Gist options
  • Save caovillanueva/8e425ede0d60c45a940bb68424107af8 to your computer and use it in GitHub Desktop.
Save caovillanueva/8e425ede0d60c45a940bb68424107af8 to your computer and use it in GitHub Desktop.
[PS:1.6 Force to postal code Canada] Remove spaces and all letter switch to upercase #PS16,#PS17
/*
* Custom code goes here.
* A template should always ship with an empty custom.js
*/
/*
MARKETING MEDIA CUSTOM CODE
*/
//Force to use uppercase in zipcodes in address. Also delete spaces (Canada post module only works with uppercase chars.)
$(function() {
$('input[name=postcode]').keyup(function() {
this.value = this.value.toLocaleUpperCase().replace(/ +/g, "");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment