
function form_validator(theForm)
{

  if (theForm.nome.value == "")
  {
    alert("Compilare il campo nome");
    theForm.nome.focus();
    return (false);
  }
     if (/@/.test(theForm.nome.value))
  {
    alert("Si prega di non inserire il carattere @ sul campo Nome");
    theForm.nome.focus();
    return (false);
  }

  if (theForm.cognome.value == "")
  {
    alert("Compilare il campo cognome");
    theForm.cognome.focus();
    return (false);
  }
     if (/@/.test(theForm.cognome.value))
  {
    alert("Si prega di non inserire il carattere @ sul campo Cognome");
    theForm.cognome.focus();
    return (false);
  }

  
    if (theForm.citta.value == "")
  {
    alert("Compilare il campo cittā");
    theForm.citta.focus();
    return (false);
  }
  
     if (/@/.test(theForm.citta.value))
  {
    alert("Si prega di non inserire il carattere @ sul campo Cittā");
    theForm.citta.focus();
    return (false);
  }

    if (theForm.telefono.value == "")
  {
    alert("Compilare il campo telefono");
    theForm.telefono.focus();
    return (false);
  }
  
     if (/@/.test(theForm.telefono.value))
  {
    alert("Si prega di non inserire il carattere @ sul campo Telefono");
    theForm.telefono.focus();
    return (false);
  }

    if (theForm.email.value == "")
  {
    alert("Compilare il campo email");
    theForm.email.focus();
    return (false);
  }


 if (theForm.email.value.length < 7)
  {
    alert("L'email inserita non č corretta");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.indexOf("@") == -1)
  {
    alert("manca il carattere @ nella email");
    theForm.email.focus();
    return (false);
  }

   if (theForm.email.value.indexOf(".") == -1)
  {
    alert("manca il punto nella email");
    theForm.email.focus();
    return (false);
  }
 
 
    if (theForm.description.value == "")
  {
    alert("Compilare il campo Note");
    theForm.description.focus();
    return (false);
  }

   if (theForm.description.value.length < 3)
  {
    alert("Informazioni nelle note insufficienti");
    theForm.description.focus();
    return (false);
  }

     if (/@/.test(theForm.description.value))
  {
    alert("Si prega di non inserire il carattere @ sul campo Descrizione");
    theForm.description.focus();
    return (false);
  }
    return (true);
}

