0

I am using the jQuery Mask Plugin and I have two formats I want to support but it's not working the way I want.

My mask formats are: F9999 V9999 M9 and F9999 V99999 M999

I am using this as the mask F9999 V9999?9 M9?99

My code:

$('#someInput').mask("F9999 V9999?9 M9?99");

I want to support optional characters in the middle but If I leave it empty and fill the next after M character everything goes one step back.

How can I use multiple masks with this plugin?

Jason
  • 15,017
  • 23
  • 85
  • 116
  • jQuery does not have a mask function. What plugin are you using? How are you calling it? Where is your code? What does your input look like? what output are you expecting? What have you tried so far???? – andrew Sep 01 '15 at 11:42
  • as a plugin I use https://plugins.jquery.com/mask/ – Trelo Paidaraili Sep 07 '15 at 08:36

1 Answers1

0

I found the solutions by myself. I needed to overide the definition $.mask.definitions['h'] = "[0-9 ]"; //allow empty character $.mask.placeholder = '_';

and the final results become

$('#someInput').mask("F9999 V9999h M9hhh");