Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > international phone number testing with javascript

Reply
Thread Tools

international phone number testing with javascript

 
 
Mark D Smith
Guest
Posts: n/a
 
      12-08-2005
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

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      12-08-2005
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)

 
Reply With Quote
 
 
 
 
Mark D Smith
Guest
Posts: n/a
 
      12-08-2005

"Evertjan." <(E-Mail Removed)> wrote in message
news:Xns97267943956B3eejj99@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

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      12-08-2005
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)

 
Reply With Quote
 
Mark D Smith
Guest
Posts: n/a
 
      12-08-2005

"Evertjan." <(E-Mail Removed)> wrote in message
news:Xns97268BADB60A9eejj99@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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript to Validate the Phone Number Field Using Javascript :-) Abhishek Javascript 5 08-07-2008 09:14 AM
Free Phone to Phone Calling.. From any phone to any other anywhere coolguy17111987 VOIP 0 07-01-2007 07:27 AM
Free Phone to Phone Calling.. From any phone to any other anywhere coolguy17111987 Cisco 0 07-01-2007 07:27 AM
How Dare Could America Industrial Property Office Be In Conspiracy With Jungang International Patent Office To Make An Extravagant International Crime ? Yeongja_Choi@yahoo.com C++ 0 06-07-2005 02:00 AM
[IP Phone 7960] Prompt for code after phone number is entered Chu Cisco 2 01-14-2004 04:07 PM



Advertisments