field "dot" detector

by indrasenareddy

HTML

<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<body>

<div class="form-group" id="parentID">
    <input class="form-control" placeholder="ID Number (10 max numbers)" id="childID" name="idnumber" type="text" maxlength="10"  required autofocus>
    <span id="checkID"></span>
</div>

</body>

JavaScript

//In this function it will disable special characters in user input but still accepts the '.' and '>' character type, what keycode is it to disable that 2 character?
$(function() {
    $('#parentID').on('keypress keyup', '#childID', function(e) {
    if(isNumber(e)){
    		
        	$("#checkID").html("");
        } else{
        //e.preventDefault();
        alert("ID number must contain numbers only");
    $("#checkID").css("color", "orange");
    
        }
});
});

function isNumber(evt) {
    evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if (charCode > 31 && (charCode <= 46 || charCode > 57)) {
        return false;
    }
    return true;
}