Solved

Form with telephone number

Posted on 2006-07-15
3
202 Views
Last Modified: 2013-12-24
Good morning,
  I have a regular form that is working but I want the telephone number input to automatically fill their data with the dashes and parenthesis  


They input 999999999
The form shows (999)-999-9999

The form passes  (999)-999-9999
0
Comment
Question by:lrbrister
[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
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
usachrisk1983 earned 500 total points
ID: 17114821
You can use:

<cfinput type="text" name="test" mask="(999)-999-9999">

But I've noticed CF a little weak in the past using MASK when you try and copy/paste data into a field, or if the user types very fast.  If you run into this, you may want to consider a javascript solution to the problem (such as formatting the text onblur-when the user leaves the field, or even after submission).

You can also use validate="telephone" to have it validate the number as a telephone number, which also helps to allow the user to include a 1 digit prefix (the number "1" before the area code), as well as a 5 digit extension.

GL!
0
 

Author Comment

by:lrbrister
ID: 17114833
usachrisk1983,
  Sorry...I didn't explain properly.

The form is on a html page.  Not a cfm page. If you have that answer fine, but I can use your answer in cf forms and I'll award your points and then input my question in the correct area if you can point me there.
0
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 17115134
If this is going to happen client side, it'll definately be a JS solution.  You can post a pointer to this in Javascript to see if you find a better answer.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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