Click here to Skip to main content
14,733,444 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to know user entered numeric or character in text box
Posted
Comments
Sergey Alexandrovich Kryukov 21-Feb-13 23:53pm
   
First of all, you need to tag your UI library or application type. In other words, what is TextBox? Exact full type name, please.
And ask the question properly. What is "to know"?
—SA
AnnuBhai 21-Feb-13 23:55pm
   
Normal Textbox
AnnuBhai 21-Feb-13 23:55pm
   
SearchingText Box for searching perpose
AnnuBhai 21-Feb-13 23:56pm
   
Actually i am using text box for searching EmpCode as well as Emp Name

See this

<script>

document.write(isNaN(123)+ "<br>");
document.write(isNaN(-1.23)+ "<br>");
document.write(isNaN(5-2)+ "<br>");
document.write(isNaN(0)+ "<br>");
document.write(isNaN("Hello")+ "<br>");
document.write(isNaN("2005/12/12")+ "<br>");

</script>
   
Use IsNumeric function for eg:-

If IsNumeric(txtNAme.Text)=True then
Statement 1
Else
Statement 2
End If
   
Check the Length of the Text; if greater than zero, then the user entered something and what else could it be?
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900