ho scritto così:
codice:function checkform(){ var myBool; myBool = true; for (var i = 0; i <= (document.forms[0].elements.length -1); i++) { var classe = document.forms[0].elements[i].className; if (classe == "Obbligatorio") { var nome = document.forms[0].elements[i].name; var id = document.forms[0].elements[i].id; var valore = document.forms[0].elements[i].value; if (valore ==""){ alert ("Il campo " + id + " è obbligatorio !"); document.forms[0].elements[i].focus(); myBool = false; break; } if(document.forms[0].tiporegistrazione.selectedIndex == 0) { alert("Per favore indichi come si intende Registrare"); document.forms[0].tiporegistrazione.focus(); return false; }else{ if ((id=="e-mail") && (valore !=="")){ var rslt = valore.match("@"); if (rslt == null){ alert ("Per favore inserisca corretamente l'indirizzo E-mail !"); document.forms[0].elements[i].focus(); myBool = false; break; } } } } } return myBool; } function soloNum(cc) { if(cc.value.match(/^\+*\d+$/) ) { return true; } else { alert("Per favore inserisca solo numeri nel campo Telefono"); document.forms[0].telefono.focus(); cc.value = ""; return false; } }
ma mi dice che "document.forms[0].tiporegistrazione.selectedIndex == 0" è nullo o non è un oggetto
cosa potrebbe essere??

Rispondi quotando