Allow Only Numeric Values in Asp.Net Textbox Using JavaScript
<html> <head> <script language="Javascript"> function isNumOnly(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } </script> </head> <body> <asp:TextBox ID="txtno" Text="" onkeydown="return isNumOnly(event)" runat="server"></asp:TextBox> </body> </html>
Comments
Post a Comment
Thank You for your Comment