?
Solved

national and international phone number input mask

Posted on 2006-06-28
6
Medium Priority
?
687 Views
Last Modified: 2009-12-16
I've got a situation where I need to be able to switch back and forth on a form control between a national and an international input mask for phone numbers. I'm not sure how to approach it. I remember reading an article about doing just this but can't for the life of me remember the source or the approach.
0
Comment
Question by:eliwil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17004985
Is it something like this

!\(999") "000\-0000;0;_


If u want international, u put in the prefix for that in front of it
0
 

Author Comment

by:eliwil
ID: 17007281
how would you go about changing the input mask? what would you use as a trigger? how would you present the choice to the user? looking for ideas?

E
0
 

Author Comment

by:eliwil
ID: 17007285
make that, I'm looking for ideas.
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:eliwil
ID: 17007392
Just did a search and came up with the following:

Title: Turn off input mask via coding

I think this will do the trick for me.

E
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 1500 total points
ID: 17007875
How to do in code,

I think u found something,

But here is one way to set the input mask

Using the mask Ive supplied, since it contains double quotes we have to include them another way

e.g.

    txtPhoneNo.InputMask = "!\(999" & Chr$(34) & ") " & Chr$(34) & "000\-0000;0;_"


0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 17056555
eliwil,

Got this from somewhere... don't remember... hope it helps!
:)

If/Then/Else/End If, InputMask, Or, Value
You need a variable Input Mask for telephone numbers. If the client is from Canada or USA, the Input Mask would force "(514) 257-0734" but if the client is from Europe, you don't want any input mask". In the Event "Get Focus" of the telephone number text box, You will write this code:
    If countryField.Value = "Canada" or countryField.Value = "USA" Then
        telephoneNumberField.InputMask = "!\(999) 000-0000;0;_"
    Else
        telephoneNumberField.InputMask = ""
    End If


Bsically you change the mask based on the country.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question