?
Solved

Form with telephone number

Posted on 2006-07-15
3
Medium Priority
?
204 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 2000 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

718 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