Click here to Skip to main content
15,940,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Enter only number in a textbox using java script validation on onkeypress
Posted
Updated 1-Oct-10 22:29pm
v2

try this ->

<asp:textbox id="txtPassword" runat="server" onkeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" xmlns:asp="#unknown">
 
Share this answer
 
Please check the following link:

Allowing Only Numbers into a Text Box

http://www.java2s.com/Code/JavaScript/Form-Control/AllowingOnlyNumbersintoaTextBox.htm[^]
 
Share this answer
 

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