JavaScript: only num in input
<input onkeypress="return !isNaN(String.fromCharCode(event.charCode || event.keyCode))">