473,732 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

us phone number validation

4 New Member
hello all !

Can any one help me in validating US Phone Number , I wrotethe javascript for this to get the phone number as 123-234-1234 but i dont know the reason why i am getting this format only after entereing the 11 digit can anyone tell me how can i solve this problem

or can anyone help me to get this format for us phonenumbers.

I want the code like while entering the digits only i should get "-" at the 4th and 8th positions and that number should have total 12 positions with 10 digits.


Thanks in advance
komala
Sep 20 '07 #1
2 2193
Plater
7,872 Recognized Expert Expert
Hmm, not sure of an ellegant way to do it with a script but could't you just have multiple textboxes?
textbox - textbox - textbox

And restrict the number of characters in each?
Sep 20 '07 #2
Frinavale
9,735 Recognized Expert Moderator Expert
hello all !

Can any one help me in validating US Phone Number , I wrotethe javascript for this to get the phone number as 123-234-1234 but i dont know the reason why i am getting this format only after entereing the 11 digit can anyone tell me how can i solve this problem

or can anyone help me to get this format for us phonenumbers.

I want the code like while entering the digits only i should get "-" at the 4th and 8th positions and that number should have total 12 positions with 10 digits.


Thanks in advance
komala
Is this a JavaScript question or a .NET question?

-Frinny
Sep 20 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

21
6246
by: AnnMarie | last post by:
<script language="JavaScript" type="text/javascript"> <!-- function validate(theForm) { var validity = true; // assume valid if(frmComments.name.value=='' && validity == true) { alert('Your full name is required. Please enter your full name!'); validity = false; frmComments.name.focus();
5
3521
by: Kamaluokeakua | last post by:
I have to write an application that deals with clients in multiple countries. The addresses, phone numbers, country id and currency information has to be stored into a database that allows for the format of any country. I would like to be able to automatically display the information in the format of their country based on the information gathered from the Country field in the database. Is there any white paper, or book or site that has...
4
11732
by: Srinivas Kollipara | last post by:
Hey guys, i have a small question in C#. I have a windows form which has Address fields, zip code and phone number fields. it is working fine with U.S. but i need to modify that for all the other countries. is there any way i can validate zipcode and phone numbers.... Thanks in advance. bye Srinivas
2
3274
by: Jeff Kiesel | last post by:
Has anyone used three textboxes for phone number input and successfully validated it? One textbox for area code, one for exchange, one for number. (yes, we're only doing US numbers) :o)
2
2243
by: Sharon Traineanu via .NET 247 | last post by:
I'm using C#.net. I have a phone number in three asp textboxes. I'd like to make the phone number required, and validate to make sure only numbers have been entered. My main problem is I can't find a way to have all three textboxes use the same validator and not display 3 error messages. -------------------------------- From: Sharon Traineanu -----------------------
10
14300
by: JackM | last post by:
I'm still working on validating the phone numbers that are entered on a form but have come across a problem I don't understand how to fix. I can handle most instances when it's in regular US formats (555-555-5555 or (555) 555-5555 or 555 555 5555) but I'm having trouble when the entry is ten consecutive numbers with nothing else (5555555555). Not only does it not validate, but it shows as 2147483647 when I call the variable to check to see...
6
27681
by: Michael R | last post by:
I haven't found anything that would help me to understand the correct syntax for having a certain number of digits phone number validation rule. My input mask for this field is: \000\-0000000;; When I set the following validation rule: 9999999999 or =9999999999 it doesn't work correctly and it allows short numbers. How should I compose it correctly. Thanks, Michael.
3
2247
by: ryushinyama | last post by:
I am wanting to remove 1's that Canadian customers put in front of their numbers because when FedEx imports them for shipping they leave the 1 and cut off the last number. Other countries numbers don't get formatted the same so they are not an issue. The code below was an attempt to remove a one at the beginning if present at all. Which should get the job done but I don't know if there are countries out there that need to start in the...
2
3080
by: ajaymohank | last post by:
Hello friends............ i am trying to get a validation for email and phone number. in my php project i am doing the validation using java script. but i am not getting validations for email and phone number correctly... please give a solution for this..
1
2102
by: thulaseeram | last post by:
Hi to All, I am using general javascript function isNAN to validate whether entered input is number or not it is doing ok. But it should take space in between code number and phone number. for Example: now it it is taking 078245378 (not allowing spaces, This is existing validation) but it should allow space like 078 245378. Please can any one help me how to validate this(i mean how to...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.