наверное, так...
<input type="text" />
<script type='text/javascript'>
document.querySelector('input').addEventListener('keyup',function(){
setCapitalLetter(this.value, this)
});
function setCapitalLetter(Val,Obj){
Obj.value = Val.toUpperCase() ;
};
</script>