prova con

codice:
<input type="text" onkeyup="v=this.value; this.value=v.replace(/\D/gi,'')">
Ciao