jQuery-Mask-Plugin icon indicating copy to clipboard operation
jQuery-Mask-Plugin copied to clipboard

Does not mask pre-loaded input

Open barrychapman opened this issue 5 years ago • 2 comments
trafficstars

Have you take a look into our docs?

yeah

Device

[Win10]

Browser (and version)?

Chrome|Firefox

Functional jsfiddle exemplifying your problem:

https://jsfiddle.net/barrychapman/L584kupw/6/

Describe de problem depth:

The issue is that when a value exists in an input field (such as editing an existing record), it does not parse it properly.

It should really perform a RegEx replace against the mask that has been defined.

So in my case, my mask consists of integers - (999) 999-9999

All characters -except- for integers should be removed, and then the mask should be applied to the raw integers. Otherwise you end up with offsets like you see in the fiddle.

Is this plugin helping you out? Buy me a beer and cheers! :beer: sort of :)

:bowtie: https://www.paypal.me/igorcescobar

barrychapman avatar Jan 22 '20 04:01 barrychapman

You need characters "-"? if not remove, mask will work fine

shayckspear avatar Jan 27 '20 13:01 shayckspear

Just remove mask characters from the value. In your sample in jsfiddle replace 248-425-865 with 2484258651.

ganix33 avatar Jan 28 '20 12:01 ganix33