473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

international phone number testing with javascript

Hi

i have to test a form for valid format of international numbers in the
format +44.1234567890
i realize that some countries have 3 numbers after the + but so far apart
from checking the number has numbers + and a . i have had no luck checking
for +NN. or +NNN.

Mark

Dec 8 '05 #1
4 3802
Mark D Smith wrote on 08 dec 2005 in comp.lang.javascript:
i have to test a form for valid format of international numbers in the
format +44.1234567890
i realize that some countries have 3 numbers after the + but so far
apart from checking the number has numbers + and a . i have had no
luck checking for +NN. or +NNN.


Not very useful, since:
the one period is not the accepted standard
there are also 1 numbered [and 3 numbered] country codes
the 10 numbers after that are not absolute
result = /^\+\d{2}\.\d{10}$/.test('+44.1234567890')

a little better:

result = /^\+\d{1,3}\.\d{10}$/.test('+44.1234567890')

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Dec 8 '05 #2

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242...
Mark D Smith wrote on 08 dec 2005 in comp.lang.javascript:
i have to test a form for valid format of international numbers in the
format +44.1234567890
i realize that some countries have 3 numbers after the + but so far
apart from checking the number has numbers + and a . i have had no
luck checking for +NN. or +NNN.


Not very useful, since:
the one period is not the accepted standard
there are also 1 numbered [and 3 numbered] country codes
the 10 numbers after that are not absolute
result = /^\+\d{2}\.\d{10}$/.test('+44.1234567890')

a little better:

result = /^\+\d{1,3}\.\d{10}$/.test('+44.1234567890')

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Hi

the format is in use by a few domain resellers that the form i use has to
send in the above format else the domains will net be accepted.
thanks for the regexp now i just need to figure out how to code it in
javascript.

Mark

Dec 8 '05 #3
Mark D Smith wrote on 08 dec 2005 in comp.lang.javascript:

result = /^\+\d{2}\.\d{10}$/.test('+44.1234567890')

a little better:

result = /^\+\d{1,3}\.\d{10}$/.test('+44.1234567890')


the format is in use by a few domain resellers that the form i use has to
send in the above format else the domains will net be accepted.
thanks for the regexp now i just need to figure out how to code it in
javascript.


But the above is javascript!

==============================

function testMyPhoneFormat(x){
return /^\+\d{1,3}\.\d{10}$/.test(x)
}
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Dec 8 '05 #4

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242...
Mark D Smith wrote on 08 dec 2005 in comp.lang.javascript:

result = /^\+\d{2}\.\d{10}$/.test('+44.1234567890')

a little better:

result = /^\+\d{1,3}\.\d{10}$/.test('+44.1234567890')


the format is in use by a few domain resellers that the form i use has to send in the above format else the domains will net be accepted.
thanks for the regexp now i just need to figure out how to code it in
javascript.


But the above is javascript!

==============================

function testMyPhoneFormat(x){
return /^\+\d{1,3}\.\d{10}$/.test(x)
}
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Sorry i am not big on javascript, more use to perl.
it makes sense now.

thanks

Mark

Dec 8 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
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...
0
by: avinash | last post by:
International Conference on Computational Intelligence and Multimedia Applications, August 16-18, 2005 University of Nevada, Las Vegas, USA (www.iccima.org) F I R S T C A L L F O R P...
5
by: Kevin Newman | last post by:
Does anyone know of any application (AJAX or other) that will display the appropriate address for for the selected (or detected) country? If not, does anyone know where I can find a list or...
3
by: venu | last post by:
Hi, I have a different requirement and it is : I need to validate a phone number field. It may or may not be a US phone number. The constraints are : *********************** # It should...
1
by: Vijay | last post by:
CSQA & CSTE Prep Courses for International Certifications by QAI,USA @Hyderabad After receiving overwhelming response to our last 50+ batches, SpectraMindSolutions.com now announces a new...
0
by: Vijay | last post by:
Prep Courses for International Certifications, CSTE & CSQA & ISEB & ISTQB &Business Analyst & SOA Certifications in HYDERABAD. After receiving overwhelming response to our last 50+ batches, ...
0
terryble
by: terryble | last post by:
hy, We are deploying IPPhone cisco(R) On this phone proprietary code exist with XML too. After code modification, a can't find the final step for this service to work. I need to post the variable...
0
by: Vijay | last post by:
Prep Courses for International Certifications by QAI,USA After receiving overwhelming response to our last 95 batches, Spectramind now announces a new batch of Prep Courses for CSQA & CSTE so as...
5
by: Abhishek | last post by:
Hi this is my another validator in javascript to validate the Phone Number :-) <script language='javascript'> function funcCheckPhoneNumber(ctrtxtMobile,e){ if(window.event){ var strkeyIE =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.