Non preoccuparti...modificando la funzione, non basta eliminare solo il "with (document.modulo)", ma bisogna anche reimpostare tutti gli if e indicare un else nel caso tutte le condizioni siano risultate false.
codice:
<script type="text/javascript">
<!--
function controllo() {
if (document.getElementById("nome").value=="") {
alert("Errore: compilare il campo NOME");
document.getElementById("nome").focus();
return false;
}
else if (document.getElementById("cognome").value=="") {
alert("Errore: compilare il campo COGNOME");
document.getElementById("cognome").focus();
return false;
}
else if (document.getElementById("indirizzo").value=="") {
alert("Errore: compilare il campo INDIRIZZO");
document.getElementById("indirizzo").focus();
return false;
}
else if (document.getElementById("citta").value=="") {
alert("Errore: compilare il campo CITTA'");
document.getElementById("citta").focus();
return false;
}
else if (document.getElementById("email").value=="") {
alert("Errore: compilare il campo EMAIL");
document.getElementById("email").focus();
return false;
}
else if (document.getElementById("telefono").value=="") {
alert("Errore: compilare il campo TELEFONO");
document.getElementById("telefono").focus();
return false;
}
else if (document.getElementById("trattamentodati").checked==false) {
alert("Errore: autorizzare il TRATTAMENTO DEI DATI");
document.getElementById("trattamentodati").focus();
return false;
}
else {
alert("Controllo effettuato con successo. Il modulo sarà inviato.");
return true;
}
}
-->
</script>
Naturalmente tutti i tuoi campi devono avere l'attributo id impostato correttamente. Puoi eliminare l'attributo name="modulo" nel form...non serve più a nulla.