Input mask for telephone numbers

M

Martin Rådbo

I need som help getting the input mask for telephone numbers correct.
We simply want to store all telephone numbers in the table without spaces, -
and other things. For example 031545480
But in the form we want them to look nice, for example 031-54 54 80

The problem is that telephone numbers has different amount of figures which
makes it difficult.
The most common variants here in Sweden are theese:
031-54 54 80 (3 plus 6)
031-789 65 41 (3 plus 7)
08-74 14 25 (2 plus 6)
08-745 65 21 (2 plus 7)

One mask I've tried is this one: !##############\ ###\ ##\ ##;1;" "

It works fine as long as the second part of the number is 7 figures long but
not if it is 6 or maybe 8 figures.

Anyone?

// Martin Rådbo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top