Forums
This topic is locked
checking for numeric values..
Posted 17 Aug 2006 07:31:32
1
has voted
17 Aug 2006 07:31:32 meenu susi posted:
checking for numeric values..hi..
i have a text box..where user input their value.
but i want to allow only numeric values not alphabets and blankspaces..
how to do this in asp..
regards
meenu
Replies
Replied 17 Aug 2006 18:35:47
17 Aug 2006 18:35:47 Patrick Woldberg replied:
IsNumeric returns True if the entire expression is recognized as a number; otherwise, it returns False. IsNumeric returns False if expression is a date expression.
The following example uses the IsNumeric function to determine whether a variable can be evaluated as a number:
Dim MyVar, MyCheck
MyVar = 53 ' Assign a value.
MyCheck = IsNumeric(MyVar) ' Returns True.
MyVar = "459.95" ' Assign a value.
MyCheck = IsNumeric(MyVar) ' Returns True.
MyVar = "45 Help" ' Assign a value.
MyCheck = IsNumeric(MyVar) ' Returns False.
--------------------------------------------------
Patrick Woldberg
Web Developer at Dynamic Zones
Administrator at DMXzone.com, FLzone.net, FWzone.net and DNzone.com
--------------------------------------------------
The following example uses the IsNumeric function to determine whether a variable can be evaluated as a number:
Dim MyVar, MyCheck
MyVar = 53 ' Assign a value.
MyCheck = IsNumeric(MyVar) ' Returns True.
MyVar = "459.95" ' Assign a value.
MyCheck = IsNumeric(MyVar) ' Returns True.
MyVar = "45 Help" ' Assign a value.
MyCheck = IsNumeric(MyVar) ' Returns False.
--------------------------------------------------
Patrick Woldberg
Web Developer at Dynamic Zones
Administrator at DMXzone.com, FLzone.net, FWzone.net and DNzone.com
--------------------------------------------------