Canadian Postal code validation case sensitive should be insensitive | XM Community
Skip to main content

Canadian Postal code validation case sensitive should be insensitive

  • June 13, 2023
  • 2 replies
  • 280 views

Forum|alt.badge.img+2

I can’t seem to submit an idea so I would just like to put out there that I’m going to have to build a regex because the Canadian zip code validation is set to be case sensitive. Respondents who are typing fast or do not want to stop to format may be bounced from a true answer and told to retype which might introduce confusion if the zip code is technically correct, just not formatted as expected. 

Alternative2: Slack verification has a one character per box format and automatically upper-cases the letters. This would be a good format to replicate for countries that have alphanumeric zip codes where formats (dash or no dash? space or no space, uppercase or lowercase, consistent or inconsistent) are more varied than the American digits-only format.

2 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • June 13, 2023

You can add a JS event handler to convert all letters to upper case as they are typed. For example:

Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" .InputText").on("input", function() {
this.value = this.value.toUpperCase();
});
});

 


JoseS
Administrator
Forum|alt.badge.img+20
  • Administrator
  • June 22, 2023

@Isadora  If you haven't already, I’d recommend posting this in on Evolve, our new product ideation program. 😁 If you’re not sure how to post your idea, check out our Product Ideation Overview and our Create an Idea post.