10

I am using Masked Input Plugin from digitalBush for jQuery, which is very simple to use.

For some cases, I want to pre-populate data for the client, so for something like this :

.mask("123999")

client will see:

123___

And will need to insert last 3 digits. It's working fine till the moment I want to pre-populate number 9, to show something like this:

129___

When I am making mask as "129999", user see 12____

Is it even possible to have mask with this plugin that is visible for the user as 129___?

Ivan Sokalskiy
  • 812
  • 7
  • 14

1 Answers1

15

You can redefine masked input definitions like this:

$.mask.definitions['9'] = '';
$.mask.definitions['d'] = '[0-9]';

And then use this mask:

.mask("129ddd")
Alexey Busygin
  • 351
  • 3
  • 4