Solved

Form with telephone number

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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
What You Need to Know when Searching for a Webhost Provider
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
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

630 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