Login    Forum    Search    FAQ   Blog

Board index » Client-Side Development » Javascript




 Page 1 of 1 [ 2 posts ] 



Author Message
 Post subject: Avoid null/blank space
 Post Posted: Thu Aug 27, 2009 9:16 am 
Offline

Joined: Sat Feb 21, 2009 2:15 pm
Posts: 62
How could i avoid a blank space and special characters and alphabets..... I mean i need to validate only numeric using JavaScript,,, in asp.net application....

_________________
The average woman would rather have beauty than brains, because the average man can see better than he can think.


Top 
 Post subject: Re: Avoid null/blank space
 Post Posted: Thu Aug 27, 2009 9:16 am 
Offline

Joined: Sat Feb 21, 2009 11:06 am
Posts: 1794
unction IsNumeric(strString) // check for valid numeric strings
Code:
{
if(!/\D/.test(strString)) return true;//IF NUMBER
else if(/^\d+\.\d+$/.test(strString)) return true;//IF A DECIMAL NUMBER HAVING AN INTEGER ON EITHER SIDE OF THE DOT(.)
else return false;
}


Top 
Display posts from previous:  Sort by  
 
 Page 1 of 1 [ 2 posts ] 




Board index » Client-Side Development » Javascript


Who is online

Users browsing this forum: No registered users and 1 guest

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron