<input name='frequency' onkeypress="event.returnValue=checkCode();"/>
function checkCode(){
return ((event.keyCode>=48)&&(event.keyCode<=57));
}
<input name='frequency' onkeypress="event.returnValue=checkCode();"/>
function checkCode(){
return ((event.keyCode>=48)&&(event.keyCode<=57));
}