this is my javascript function to prevent user not to enter alphabets and special characters in the textbox field, it works fine but it is not even accepting numeric.
please note that it is working fine Firefox.
function isNumber(event) {
var regex = new RegExp("^[0-9]+$");
var str = String.fromCharCode(!event.charCode ? event.which : event.charCode);
if (regex.test(str)) {
return true;
}
if (window.event) {
window.event.returnValue = false;
}
return false;
}
and this is my textbox
<asp:TextBox Width="50px" ID="placesvis" runat="server" onkeypress="isNumber(event);"