L
L
ligisayan2021-08-05 15:31:35
JavaScript
ligisayan, 2021-08-05 15:31:35

How to use a mask to check for operator codes in the phone field?

There is a form with a field for entering a phone number, which provides input by mask. For this purpose, I use the imask.js

library. In connection with this, 2 questions that interest me:

How to check for operator codes from 700 to 709, 747, 750-751, 760-764, 771, 775-778 inside brackets ()
How to format the resulting phoneMask.unmaskedValue as +70000000000 not outside the mask options (as I did now) but inside at the level of the mask itself?
let valueWithPref = "+7"+phoneMask.unmaskedValue;


Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question