TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
gokilavasan m
NA
51
37.1k
help regarding javascript
Jul 23 2012 6:16 AM
hi,
i have one textbox validation in javascript.in that validation does not allow the alphabets.it only allows the numbers and dot.
function isNumericDot(ID,alertMsg,keyCode)
{
if((keyCode >= 48 && keyCode <= 57 || keyCode == 8 || keyCode==46 || keyCode==9 ||keyCode == 33 || keyCode == 34 || keyCode == 35 || keyCode == 36 || keyCode == 37 || keyCode == 38 ||
keyCode == 39 || keyCode == 40 || keyCode == 45 || keyCode == 190 || keyCode == 46 || keyCode == 110 ||(keyCode >= 96 && keyCode <= 105)) && isShift == false || keyCode == 13 || keyCode == 16 || keyCode == 20)
{
if(keyCode==16)
isShift = true;
return ((keyCode >= 48 && keyCode <= 57 || keyCode == 8 ||keyCode==46 || keyCode==9 ||keyCode == 33 || keyCode == 34 || keyCode == 35 || keyCode == 36 || keyCode == 37 || keyCode == 38 ||
keyCode == 39 || keyCode == 40 || keyCode == 45 || keyCode == 190 || keyCode == 46 || keyCode == 110 ||(keyCode >= 96 && keyCode <= 105)) && isShift == false || keyCode == 13 || keyCode == 16 || keyCode == 20);
}
else
{
isShift = false;
alert(" Please Enter Numbers and Dot Only");
document.getElementById(ID).value= document.getElementById(ID).value.substring(0, document.getElementById(ID).value.length-1);
return false;
}
}
but i need zero doesnot allowed at first. what can i do
Examples:allowed: 0.2,0.002
NotAllowed: 0,asd,@,$, ,
Reply
Answers (
1
)
How to read the JSON file in the Folder using jQuery in ASP.NET?
How to drag and drop images from Pretty Photo gallery