Connecting Tech Pros Worldwide Help | Site Map

Javascript validation for enter telephone number

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 17th, 2006, 01:45 AM
Sirisha
Guest
 
Posts: n/a
Default Javascript validation for enter telephone number

I have one textbox for enter telephone numbers.
i want that text box can accepts only 0 to 9 digits and one sapcace,
-,special characters.

I want Javascript script validation for that text box.





Sirisha


  #2  
Old November 17th, 2006, 01:55 AM
Randy Webb
Guest
 
Posts: n/a
Default Re: Javascript validation for enter telephone number

Sirisha said the following on 11/16/2006 10:05 PM:
Quote:
I have one textbox for enter telephone numbers.
i want that text box can accepts only 0 to 9 digits and one sapcace,
-,special characters.
>
I want Javascript script validation for that text box.
Then write one?

Write *something* and post it. Don't expect someone to write it from
scratch. Search the archives for "phone number validation".

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
  #3  
Old November 17th, 2006, 07:35 AM
Evertjan.
Guest
 
Posts: n/a
Default Re: Javascript validation for enter telephone number

Randy Webb wrote on 17 nov 2006 in comp.lang.javascript:
Quote:
Sirisha said the following on 11/16/2006 10:05 PM:
Quote:
>I have one textbox for enter telephone numbers.
> i want that text box can accepts only 0 to 9 digits and one sapcace,
>-,special characters.
>>
> I want Javascript script validation for that text box.
>
Then write one?
>
Write *something* and post it. Don't expect someone to write it from
scratch. Search the archives for "phone number validation".
... and tell us for what country and net you want it dane.

My only "sapcace" has been lost while zapping.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
  #4  
Old January 9th, 2007, 05:35 AM
rdtiwari7@gmail.com
Guest
 
Posts: n/a
Default Re: Javascript validation for enter telephone number


Sirisha wrote:
Quote:
I have one textbox for enter telephone numbers.
i want that text box can accepts only 0 to 9 digits and one sapcace,
-,special characters.
>
I want Javascript script validation for that text box.
>
>
>
>
>
Rastra Deep Tiwari
  #5  
Old January 9th, 2007, 08:25 AM
Evertjan.
Guest
 
Posts: n/a
Default Re: Javascript validation for enter telephone number

Sirisha wrote on 17 nov 2006 in comp.lang.javascript:
Quote:
I have one textbox for enter telephone numbers.
i want that text box can accepts only 0 to 9 digits and one sapcace,
-,special characters.
>
I want Javascript script validation for that text box.
Never restrict textbox entry, as this confuses the user,
making a backspace on a typed in character that was rejected,
deleting another one than expected, etc.

Validation is ok, read up on regex.

testResult = !/[\d \-]/.test(tNr)

will test for "not 0123456789 -"

I cannot find a "sapcace" on my keyboard, btw ;-}


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.