1

I am using the inputMask-tag of primefaces which adds the maskedinput-plugin of jQuery to my application.

I have a input field with this mask:

***-999

The user should be able to leave some characters empty (e.g. for a search-form)

I´ve found this post in stackoverflow. So i changed my mask to:

?***-999

Here is a example-input: _ _ _ 123 (user just enters the last 3 digits)

If the user unfocuses the input-field the input field contains this value:

123

If he focuses the input-field again it contains this value:

123-_23

Is there something i can do to make my example work?

Community
  • 1
  • 1
CSan
  • 954
  • 1
  • 10
  • 25

1 Answers1

0

Just in case you still struggling I wrote similar plugin a while ago that masks fields and works fine with situation you described above. See example usage at:

http://tomaszegiert.seowebsolutions.com.au/maskit/index.html

Optional fields example you would be interested in is 23rd from the top if I counted correctly. I hope it will help someone.

spirytus
  • 10,726
  • 14
  • 61
  • 75