473,411 Members | 1,949 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,411 software developers and data experts.

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

Nov 17 '06 #1
4 11626
Sirisha said the following on 11/16/2006 10:05 PM:
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/
Nov 17 '06 #2
Randy Webb wrote on 17 nov 2006 in comp.lang.javascript:
Sirisha said the following on 11/16/2006 10:05 PM:
>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)
Nov 17 '06 #3

Sirisha wrote:
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
Jan 9 '07 #4
Sirisha wrote on 17 nov 2006 in comp.lang.javascript:
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)
Jan 9 '07 #5

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

Similar topics

8
by: Eric Linders | last post by:
Hi, I'm trying to figure out the most efficient method for taking the first character in a string (which will be a number), and use it as a variable to check to see if the other numbers in the...
2
by: diong | last post by:
I had a problem in validating my asp page..the field HomeTelno is not a required field..but it always ask for a phone number. How can i validate the field that the user had inputed numbers not...
7
by: AnnMarie | last post by:
My JavaScript Form Validation doesn't work at all in Netscape, but it works fine in IE. I made some of the suggested changes which enabled it to work in IE. I couldn't make all the changes...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
6
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: ...
9
by: effendi | last post by:
I wrote a very simple validation fucntion to check if all fields are entered properly in a dialog box before returning this the values to the parent form. The validation works finr however, I am...
2
by: R Bolling | last post by:
I am using a routine to check to see if a phone number (PK) has alread been entered, and takes the user to that record if it is found -- as follows: Private Sub...
1
by: Sirisha | last post by:
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
7
chunk1978
by: chunk1978 | last post by:
hi everyone, this may seem like a lazy post, but it's not... i've been searching for a while and everything i've read seems different than others (and none of it works either, for me anyway)... in...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
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,...
0
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...
0
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...

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.