Codice PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
title>Untitled Document</title>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<
script type="text/JavaScript">
function 
check(el){
    if(
isNaN(el.value)){
        
alert('Solo numeri');
    }
}
</script>

</head>

<body>
<form action="" method="post">
<input  name="title"  onKeyUp="check(this)"title="Comment name" type="text" value="" id="title-comment"  />

</form>
</body>
</html>