function checkFormNoleggio() { error = 0; msg = ''; if (document.richiesta.mittente.value == "") { msg = msg + 'Il campo "Mittente" non può essere vuoto.\n'; error = 1; } if (document.richiesta.numeroposti.value == "") { msg = msg + 'Il campo "Numero di posti" non può essere vuoto.\n'; error = 1; } if (document.richiesta.datainizio.value == "") { msg = msg + 'Il campo "Data inizio" non può essere vuoto.\n'; error = 1; } if (document.richiesta.datafine.value == "") { msg = msg + 'Il campo "Data fine" non può essere vuoto.\n'; error = 1; } if (document.richiesta.nome.value == "") { msg = msg + 'Il campo "Nome" non può essere vuoto.\n'; error = 1; } if (document.richiesta.indirizzo.value == "") { msg = msg + 'Il campo "Indirizzo" non può essere vuoto.\n'; error = 1; } if (document.richiesta.azienda.value == "") { msg = msg + 'Il campo "Azienda" non può essere vuoto.\n'; error = 1; } if (document.richiesta.citta.value == "") { msg = msg + 'Il campo "Città" non può essere vuoto.\n'; error = 1; } var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$"; var regex = new RegExp(emailReg); if (document.richiesta.email.value == "") { msg = msg + 'Il campo "e-Mail" non può essere vuoto.\n'; error = 1; } else { if (!(regex.test(document.richiesta.email.value))) { msg = msg + 'Il campo "e-Mail" non è corretto\n'; error = 1; } } if (document.richiesta.telefono.value == "") { msg = msg + 'Il campo "Telefono" non può essere vuoto.\n'; error = 1; } if (document.richiesta.note.value == "") { msg = msg + 'Il campo "Note" non può essere vuoto.\n'; error = 1; } if (document.richiesta.trattamento1.checked == false) { msg = msg + 'Il consenso al trattamento dei dati è necessario.\n'; error = 1; } if (error == 1) { alert (msg); return false; } else { document.richiesta.submit(); return true; } } function checkFormInfo() { error = 0; msg = ''; if (document.info.nome.value == "") { msg = msg + 'Il campo "Nome" non può essere vuoto.\n'; error = 1; } if (document.info.cognome.value == "") { msg = msg + 'Il campo "Cognome" non può essere vuoto.\n'; error = 1; } if (document.info.telefono.value == "") { msg = msg + 'Il campo "Telefono" non può essere vuoto.\n'; error = 1; } if (document.info.indirizzo.value == "") { msg = msg + 'Il campo "Indirizzo" non può essere vuoto.\n'; error = 1; } if (document.info.azienda.value == "") { msg = msg + 'Il campo "Azienda" non può essere vuoto.\n'; error = 1; } if (document.info.citta.value == "") { msg = msg + 'Il campo "Città" non può essere vuoto.\n'; error = 1; } var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$"; var regex = new RegExp(emailReg); if (document.info.email.value == "") { msg = msg + 'Il campo "e-Mail" non può essere vuoto.\n'; error = 1; } else { if (!(regex.test(document.info.email.value))) { msg = msg + 'Il campo "e-Mail" non è corretto\n'; error = 1; } } if (document.info.messaggio.value == "") { msg = msg + 'Il campo "Messaggio" non può essere vuoto.\n'; error = 1; } if (document.info.trattamento1.checked == false) { msg = msg + 'Il consenso al trattamento dei dati è necessario.\n'; error = 1; } if (error == 1) { alert (msg); return false; } else { document.info.submit(); return true; } }