<!-- Da copiare tra i tag HEAD --> <SCRIPT LANGUAGE="JavaScript"> <!-- function resetform() { document.forms[0].elements[1] == ""; } function submitForms() {
if (isEmail() && isFname() && isLname() && isAddress() && isCity() && isState() && isZip()) if (confirm("Confermi?")) { alert("Invio in corso"); return true; }
else
{ alert("Non hai confermato"); return false; }
else
return false; }
function isEmail() {
if (document.forms[0].elements[1].value == "") { alert("Inserisci l\'email.") document.forms[0].elements[1].focus(); return false; }
if (document.forms[0].elements[1].value.indexOf('@',0) == -1 || document.forms[0].elements[1].value.indexOf('.',0) == -1) { alert("Email non valida") document.forms[0].elements[1].select(); document.forms[0].elements[1].focus(); return false; }
return true; }
function isFname() {
if (document.forms[0].elements[2].value == "") { alert("Inserisci il nome.") document.forms[0].elements[2].focus(); return false; }
return true; }
function isLname() {
if (document.forms[0].elements[3].value == "") { alert("Inserisci il cognome ") document.forms[0].elements[3].focus(); return false; }
return true; }
function isAddress() {
if (document.forms[0].elements[4].value == "") { alert("Inserisci l\'indirizzo ") document.forms[0].elements[4].focus(); return false; }
return true; }
function isCity() {
if (document.forms[0].elements[5].value == "") { alert("Inserisci la città ") document.forms[0].elements[5].focus(); return false; }
return true; }
function isState() {
if (document.forms[0].elements[6].value == "") { alert("Inserisci lo stato ") document.forms[0].elements[6].focus(); return false; }
return true; }