Solved

Form with telephone number

Posted on 2006-07-15
3
198 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now