Inputmask with certain values

0

I am using input mask for a phone format:

$('.selector').inputmask("(09\1) 999-9999");

0 and 1 are standard, and I only store the other numbers, the problem is that when I reload my page if I complete them with '1111111' I lose the last number because I take it as part of the mask

Any ideas?

    
asked by FaDev 31.10.2017 в 19:00
source

1 answer

0

I get the numbers first with a regular expression

var telefonoCasa = $("#telefonoCasa").val().match( /\d+/g);
telefonoCasa = telefonoCasa.join("");

you would already have all the input numbers and make your validations if you do not want to store the 1 and 0

    
answered by 31.10.2017 в 19:10