You are viewing limited content. For full access, please sign in.

Question

Question

Masking field with letters or mixed content

asked on March 24, 2015

I have a form where I'd like to set up an input mask for a Canadian postal code.  In the various examples, I can see how number formats can be applied referencing a phone number or social insurance number (using either the phone or ssn CSS classes, respectively), however based on the following post on the jQuery plugin, I had tried referencing the mixed CSS class, using a mask of "S0S 0S0", but this didn't seem to apply properly.

Is there possibly a different way I should be referencing this mask?  I also noticed that the above post used 0's for any numeric input masks instead of 9's, might there be a different way I'd need to reference letters?

Please let me know any suggestions you may have - thanks in advance!

Marty Gaffney - Network Technician

Town of Okotoks

1 0

Answer

SELECTED ANSWER
replied on March 24, 2015

Hi Marty,

I downloaded the plugin from here and placed a copy of jquery.mask.min.js into my js folder (default C:\Program Files\Laserfiche\Laserfiche Forms\Forms\js).

I created a form with a single line input and gave it the CSS class cpc. In the javascript section, I used the following:

$(document).ready(function(){
  $.getScript('http://server/forms/js/jquery.mask.min.js', function() {
    $('.cpc input').mask('S0S 0S0');
  });
});

The masking worked for me. Can you describe your scenario in more detail and explain what's not working for you?

Regards

2 0

Replies

replied on March 24, 2015 Show version history

Hey Alex:

That's perfect - I was able to tweak my form so it now only accepts a valid postal code.  Now I can reference this CSS code and ensure a Canadian postal code is entered properly.

Thanks much!

Marty

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.