How to prevent input only numbers and commas in the textbox. I've searched and only got to prevent numbers.
<script type="text/javascript">
function CheckNumeric(e) {
if (window.event) // IE
{
if ((e.keyCode < 48 || e.keyCode > 57) & e.keyCode != 8) {
event.returnValue = false;
return false;
}
}
else { // Fire Fox
if ((e.which < 48 || e.which > 57) & e.which != 8) {
e.preventDefault();
return false;
}
}
}
</script>
<input type="text" class="form-control form-control-line" placeholder="3.5 of 4"
id="Text1" runat="server" onkeypress="CheckNumeric(event);">