<script type="text/javascript"> function checkIt(evt) { evt = (evt) ? evt : window.event var charCode = (evt.which) ? evt.which : evt.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) { alert("Only Numbers allowed"); return false } document.getElementById("errorMessage").innerHTML = "" return true } function Changed( textControl ) { if(textControl.value.indexOf(".") !== -1) { alert("decimal values not allowed");textControl.value='';return false; } return true; } </script> <asp:TextBox ID="TextBox1" runat="server" onKeyPress="return checkIt(event)" onchange="javascript: Changed(this);" ></asp:TextBox>
Wednesday, April 3, 2013
Only numbers decimal not allowed
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment