Solved

Form with telephone number

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

13 Experts available now in Live!

Get 1:1 Help Now