prova così:

codice:
<input type="text" onChange="if (!(/^\D$/.test(this.value))) this.value='';">
ciao