-2

The goal is for the user to input a 9 digit number or a string with the value "YOUR NAME". Something like:

 <input type="text"
        data-inputmask="'mask': '(999999999)|(YOUR NAME)'">

I know that doesn't work, but I've tried a lot of different variations and none work.

Is there a way to do this with jquery inputmask?

Todd Hoff
  • 712
  • 5
  • 12

1 Answers1

0

The secret is you need to escape constant values. As in:

data-inputmask="'mask': '(999999999)|(\\Y\\O\\U\\R\\ \\N\\A\\M\\E)','rightAlign':false"
Todd Hoff
  • 712
  • 5
  • 12