Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in Javascript only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
Javascript
validate numbers
validate numbers
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
nussu
New Member
Join Date:
Nov 2007
Posts:
23
#1
validate numbers
Feb 28 '08, 04:53 AM
Hi,
How to check a number which should not start with 80 using javascript.
Please help me
Regards,
Nussu
gits
Recognized Expert
Moderator
Expert
Join Date:
May 2007
Posts:
5390
#2
Feb 28 '08, 08:43 AM
hi ...
we may use e regExp for this ... here is an example:
[CODE=javascript]var no = '90567';
function no_starts_with( no, val) {
var re = new RegExp('^' + val);
return re.test(no);
}
// that would return false :) actually
no_starts_with( no, 80);
[/CODE]
kind regards
Comment
Post
Cancel
acoder
Recognized Expert
MVP
Join Date:
Nov 2006
Posts:
16032
#3
Feb 28 '08, 08:50 AM
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
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment