Always separate markup/layout (HTML) from business/controller/dynamic logic. In other words - never write JS in HTML and never use on-attributes.
Same goes to styles. Never use style attribute. Use CSS instead.
Whenver you want multiple event listeners added use node.addEventListener('eventname', handler)
However, in your case you, probably, you want to call checkID as a part of your validation logic in the same event listener.
Create a JS file, for example app.js and add before </body> - <script src="app.js"></script>
var input = document.getElementById('id');
input.addEventListener('keypress', function (event) {
if (event.charCode >= 48 && event.charCode <= 57) {
checkID(input.value);
return true;
} else {
return false;
});
// you can add as many listeners as you want
// they all will be called in the order you attached them
// however, different event handlers should be absolutely independent
// and shouldn't know about each other. If you need to do something within one flow,
// then do everything in one handler
input.addEventListener('keypress', handler2);
// ...