Ciao AleXXandra,

esisterà sicuramente qualcosa di già pronto... io ho fatto questo
codice:
<script language="javascript">
function ControlloNumero(obj){
  var numero = "positivo";
  if (obj.value.substr(0,1)=="-") numero = "negativo";
  valore = obj.value.replace(/[^\d]/g,'').replace(/^0+/g,'');
  nuovovalore='';
  while(valore.length>3){
    nuovovalore='.'+valore.substr(valore.length-3)+nuovovalore
    valore = valore.substr(0,valore.length-3)
  }
  if (numero=="negativo")obj.value="-"+valore+nuovovalore
  else obj.value=valore+nuovovalore
}
</script>
<form onsubmit="this.NomeText.value=this.NomeText.value.replace(/\./g,'');">
<input type="text" name="NomeText" value="" onkeyup="ControlloNumero(this)">
<input type="submit" value="submit">
</form>
Accetta numeri interi positivi o negativi, le migliaia vengono separate dal punto e all'onsubmit elimino tutti i punti