ragazzi mi blocca qualke sciocchezza ........
ho questo form
Codice PHP:
<form name="modulo" method="post" action="send_modulo_pagine.php" onSubmit="return checkForm(this)">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>Referente:</td>
<td><input type="text" name="referente" id="referente"></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email" id="email"></td>
</tr>
<tr>
<td>Telefono:</td>
<td><input name="descrizione" type="text" id="descrizione" value="" /></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td><label>
<input name="button" type="button" onClick="Modulo()" value="Invia">
</label></td>
</tr>
</table>
</form>
ma prima di inviare il form al file "send_modulo_pagine.php" faccio un controllo con un file javascript
Codice PHP:
function Modulo() {
var mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if ((document.modulo.referente.value == "")) {
alert("Il campo Referente è obbligatorio");
document.modulo.referente.focus();
return false;
}
else if ((document.modulo.email.value == "")) {
alert("Il campo email è obbligatorio");
document.modulo.email.focus();
return false;
} else if (!mail.test(document.modulo.email.value)) {
alert("Il campo email è errato");
document.modulo.email.focus();
return false;
}
else if ((document.modulo.descrizione.value == "")) {
alert("Il campo descrizione è obbligatorio");
document.modulo.descrizione.focus();
return false;
}
else {
document.modulo.action = "../send_modulo_pagine.php";
document.modulo.submit();
}
}
ma c'è un errore:
ecco l'errore grazie per l'aiuto
line: 4
carattere: 8
errore "document.modulo.nick.value" è nullo o non è un oggetto
codice: 0