6

I have a problem to validate data- mask.

<strike><input type="text" data-mask="a-99999999-9"></strike>

I need you where going "a" only become available the letters " VEJPG ".

if anyone knows how it could do so thanks.

Hadi
  • 36,233
  • 13
  • 65
  • 124

1 Answers1

2

JQuery Mask plugin doesn't recognize "a" in the mask expression, it supports "A" This will work:

<strike><input type="text" data-mask="A-99999999-9"></strike>

If you want the first letter to only V or E or J or P or G then you have to call the mask constructor in javascript as follow:

$("#idOfTextInput").mask("v-9999999-9",{translation: {'v':{pattern:/[VEJPG]/}}});