codice:
 function checkNum(field, type){
	
	var stringa = field.value;
	replaced = stringa.replace(/\./g,''); // elimina tutti i punti

	var rex = /^[0-9]+(,)?([0-9]+)?$/
	if(!rex.test(replaced)){
		alert('Errore\nIl numero inserito nel campo '+type+' non è nel formato corretto.\n\nFormato accettato: 0000,00');
		field.value = "";
	}
}
HTH ... Zappa