D
D
Dommager2018-03-18 11:43:32
JavaScript
Dommager, 2018-03-18 11:43:32

How to set mask for phone number in table cell?

Hello, how can I make the +X(XXX)XXX-XX-XX mask apply to the emp.Number field?
What type of data should this field be in the database?

Code snippet (output data to html table)

$(data).each(function (index, emp) {
st = emp.Id;
if (st2 < st) {
st2 = st;
(employeeTable).append('' + emp .Id + ''
+ emp.Name + '' + emp.Surname
+ '' + emp.Patronymic + '' + emp.Birthday
+ '' + emp.Salary + '' + emp.Position + '' + emp. Number + '');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2018-03-18
@Stalker_RED

There are many plugins for such masks, choose which one you like
https://www.google.com/search?q=jquery+phone+mask+...
This is a string (varchar) in the database.
To understand why this is so: Misconceptions of programmers about phone numbers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question