// JavaScript Document
//Controlla il form prima di spedirlo
function ValidateForm(){
var f=document.form;
var Cognome = f.cognome.value;
var Nome = f.nome.value;
var Email = f.mail.value;
var Privacy = f.radiobutton[1];
if(Cognome == ""){
alert("Il Cognome è obbligatorio");
f.cognome.focus();
return false;
}
if(Nome == ""){
alert("Il Nome è obbligatorio");
f.nome.focus();
return false;
}
if(Email == ""){
alert("Indirizzo mail è obbligatorio");
f.mail.focus();
return false;
}
if(!Email.match(/^[\A-Za-z0-9_\.-]+@[\A-Za-z0-9_\.-]+\.[a-z]{2,3}$/)){
alert("Indirizzo mail errato");
f.mail.focus();
return false;
}
if(Privacy.checked){
alert("Devi accettare la legge sulla privacy");
return false;
}
}