473,503 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

validate numbers

23 New Member
Hi,
How to check a number which should not start with 80 using javascript.

Please help me

Regards,

Nussu
Feb 28 '08 #1
2 1055
gits
5,390 Recognized Expert Moderator Expert
hi ...

we may use e regExp for this ... here is an example:

Expand|Select|Wrap|Line Numbers
  1. var no = '90567';
  2.  
  3. function no_starts_with(no, val) {
  4.     var re  = new RegExp('^' + val);
  5.  
  6.     return re.test(no);
  7. }
  8.  
  9. // that would return false :) actually
  10. no_starts_with(no, 80);
  11.  
kind regards
Feb 28 '08 #2
acoder
16,027 Recognized Expert Moderator MVP
Please remember to provide a meaningful Title for any threads started (see the FAQ entry Use a Good Thread Title).

This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

MODERATOR
Feb 28 '08 #3

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

Similar topics

13
4760
by: Eddie | last post by:
I need to validate a text input field. I just want to say if user enters 93101 or 93102 or 93103 or 93105 or 93106 or 93107 or 93108 or 93109 or 93110 or 93111 or 93116 or 93117 or 93118 or...
10
2971
by: KathyB | last post by:
Hi, I just can't get this quite right. I use the following function to validate a user entry. I need to allow negative numbers including those with decimals (e.g., -.5). The following allows the...
24
7084
by: Arno R | last post by:
Hi all, I have a client with several shoe-shops. Customers can leave their email-address if they want to be notified when there is a sale. Input is validated with instr() I am checking for @...
1
2982
by: Grey | last post by:
Can I use RegularExpressionValidator to validate the user is input number or not? how to do that???
2
3084
by: Cortvriend Andy | last post by:
hi i'm filling an dropdownlist with data from sql server now i want to validate if a selection have been made the problem is that the validator never shows up i think he always says that...
10
1963
by: Mike Logan | last post by:
I am using the "contract first" design methodology. Contract First is design the WSDL first then design the server and client. However I must design my XSD/XML Schema before anything. I am...
1
2588
by: Dan1 | last post by:
Hi Guys, I have borrowed below VB code which I like to use to validate card numbers in ms access 2003 Database text box"CardNumber" The card will be checked as the user clicks a command buttom and...
1
3107
by: saravanatmm | last post by:
I need javascript code for validate the email address. Email address field cannot allowed the capital letters, special characters except '@' symbol. But can allowed the small letters, numeric...
6
5290
by: krishnaneeraja | last post by:
Hi, Iam developing windows application using vb.net with c#.net.In this i want to validate textbox accept only negative float numbers like -2.3 etc.... please help me.
5
2624
by: ghjk | last post by:
I have a web site with several web pages. They are having different number of variables. eg: first page having 4 variables in the form(Name, Phone, ID, Gender) second page having 10 variables in the...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7460
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
5578
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
4672
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...
0
3167
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...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.