codice:
<html>
<head>
<SCRIPT language="JavaScript">
<!--
function CheckForm () {
var errorMsg = "";
if (document.frmEnquiry.NomeFornitore.value == ""){
errorMsg += "\n\tNomeFornitore \t- Il campo \"\Nome del Fornitore\"\ è un campo obbligatorio";
}
if (document.frmEnquiry.CodiceProdottoFornitore.value == ""){
errorMsg += "\n\tCodiceProdottoFornitore \t- Il campo \"\Codice Prodotto del Fornitore\"\ è un campo obbligatorio";
}
if (document.frmEnquiry.DescrizioneProdotto.value == ""){
errorMsg += "\n\tDescrizioneProdotto \t- Il campo \"\Descrizione Prodotto\"\ è un campo obbligatorio";
}
if (document.frmEnquiry.UM.value == ""){
errorMsg += "\n\tUM \t- Il campo \"\Unità di misura\"\ è un campo obbligatorio";
}
if (document.frmEnquiry.CostoUnitario.value == ""){
errorMsg += "\n\tCostoUnitario \t- Il campo \"\Costo Unitario\"\ è un campo obbligatorio";
}
if (errorMsg != ""){
msg = "______________________________________________________________\n\n";
msg += "La registrazione del Nuovo Fornitore non è avvenuta a causa di problemi nella compilazione del formulario.\n";
msg += "Per favore correggere i campi errati.\n";
msg += "______________________________________________________________\n\n";
msg += "Il seguente campo/i deve essere corretto: -\n";
errorMsg += alert(msg + errorMsg + "\n\n");
return false;
}
return true;
}
// -->
</script>
</head>
<form method="POST" name="frmEnquiry" action="ProcessaFormInsFornitore.asp" onSubmit="return CheckForm();">