473,761 Members | 2,440 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to allow spaces in between phone and code number?

23 New Member
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 allow spaces in between code and phone number.

Thanks
Ram
Apr 11 '08 #1
1 2103
mrhoo
428 Contributor
it should allow space like 078 245378
Your example was not a valid us phone number, and would fail this test:

var okphonenum=/^\d{3} *\d{7}$/.test(inputvalu e)
Apr 11 '08 #2

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

Similar topics

3
2129
by: iStrain | last post by:
Hiya. I'm _sure_ this is an FAQ, but Googling hasn't produced the answer in a way I can make sense out of. I know I should get this, but so far no way... I'm creating tables and doing queries in Perl, and Nulls have started to bother me greatly. The first issue is, as far as I understand it, a column should be NOT NULL if it is necessary (required) data. Now, if a column doesn't have to be NOT NULL; that is, it's not _required_ data,...
4
1882
by: Mike | last post by:
Hi! I'm putting together a data entry form. One of the entries will be a telephone number. I've been directed to implement this by using three separate fields -- the first being for area code, the second for exchange, and the last for the last 4 digits of the phone number. When users enter 3 digits in the area code field, instead of hitting the tab key to move to the exchange field, I want this to happen automatically upon entry of...
2
12977
by: deko | last post by:
The below code dials a phone number using C:\Program Files\Windows NT\dialer.exe. The problem is that dialing rules are ignored. MS Knowledge Base Article 266253 suggests that entering the phone numbers in canonical format, e.g. +011 (408) 2578652, will fix the problem -- but I tried and it didn't work. I'm wondering if anyone can recommend an alternate phone dialer -- preferable one that does not use a GUI like dialer.exe, which...
5
4077
by: Marco Gallo | last post by:
I've been trying to get rid of extra spaces in a table that I created with addresses in it. For instance in a field called TEST, I got the following address: " 1 main st Apt A " First I tried to use the "trim", "ltrim" and "rtrim" functions, these functions did work, but only for those spaces at the beginning and at
1
1807
by: Arjen | last post by:
Hello, In code view I use a tab as mark-up character. When I run my web application I can see the tabs with the source viewer in my browser. Is there a way to remove the tabs, extra spaces and lines when running the web application? I want to remove them for performance reasons.
1
6791
by: qwerty | last post by:
My end goal is to have a script that takes user input from one pageA, submits to pageB which then displays the parameter values entered on PageA. My problem is that the values are being displayed with any included spaces being replaced with the plus sign. Any help would be appreciated. pageA code: <html> <body> <form type="get" action="pageB.html" target="new"...
12
5068
by: Wayne | last post by:
I have been given the task of rewriting a database that seems as though it has been written by someone with a very basic understanding of Access. Many of the object names and field names in tables are overly long and contain spaces e.g. "Next of kin phone number" instead of something like "KinPhNo". I am looking for opinions on whether I should spend considerable extra development time and "fix" all the problem names. I know that this...
0
1222
by: padmagvs | last post by:
I have a wsdl something like this <?xml version="1.0" ?> <definitions targetNamespace="http://abc.com/namespace/wsif/samples/abc" xmlns:tns="http://abc.com/namespace/wsif/samples/abc" xmlns:typens="urn:xml-soap-address-demo" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
7
3773
by: shapper | last post by:
Hello, I need to format phone numbers for easier reading: 961239070 becomes 96 123 90 70 So a space is introduced always on the places of the example. How can I do this? And can I use a Regex?
0
9522
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
9336
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
9948
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...
0
9765
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...
0
8770
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7327
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
6603
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
5215
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...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.