D
D
DreHows2015-09-03 13:35:24
JavaScript
DreHows, 2015-09-03 13:35:24

How to disable the input of eight in the phone?

There is a text field with a mask like "+7 (___) ___-__-__".
When you start typing, characters begin to appear in brackets, that is, starting with the operator code.

Some users do not look at what they enter, and enter the phone number there starting from the eight, as a result, they cannot be reached later.

How can I use JQuery to catch the first entered character and throw out an alert if it is a seven, eight or the "+" symbol?

I'm a total noob at Jquery, please help!

UPD: All Russian mobile operator codes start with nine.
The question concerns specifically mobile operators, landline phone numbers should not fall into the database.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
s0ci0pat, 2015-09-03
@s0ci0pat

And if the client, for example, is from Rostov or St. Petersburg?

S
sitev_ru, 2015-09-03
@sitev_ru

When you enter the phone, do you go to the next field? If not, then shift the digits of the number to the left

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question