devo effettuare la convalida di iun form prima di poterlo inviare
ho provato in mille modi diversi ma non ne funziona uno!!!!
tra i tanti uno è questo:
[CODE]function validate(){
document.getElementById('Submit').disabled='disabl ed';
if (document.getElementById('nome').value==""){
alert ("Errore: compilare il campo NOME");
document.getElementById('Submit').disabled = false;
return false;
}
else if (document.getElementById('cognome').value==""){
alert ("Errore: compilare il campo COGNOME");
document.getElementById('Submit').disabled = false;
return false;
}
else if (document.getElementById('eta').value==""){
alert ("Errore: compilare il campo ETA");
document.getElementById('Submit').disabled = false;
return false;
}
else if (document.getElementById('cellulare').value==""){
alert ("Errore: compilare il campo CELLULARE");
document.getElementById('Submit').disabled = false;
return false;
}
else if (document.getElementById('professione').value=="") {
alert ("Errore: compilare il campo PROFESSIONE");
document.getElementById('Submit').disabled = false;
return false;
}
else if (document.form1.email.indexOf("@")==(-1) || email.indexOf(".")==(-1)) {
alert("Inserisci un indirizzo e-mail valido");
document.getElementById('Submit').disabled = false;
return.false;
}
else if (document.getElementById('citta').value==""){
alert ("Errore: compilare il campo CITTA");
document.getElementById('Submit').disabled = false;
return false;
}
else if (document.form1.categoria1.checked==false || document.form1.categoria2.checked==false ||){
alert ("Errore: compilare il campo CATEGORIA DI INTERESSE");
document.getElementById('Submit').disabled = false;
return false;
}
return true;
}