ho trovato questo codice
<script language="JavaScript">
function verEmail(stringa) {
if (stringa.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
return true;
else return false;
}
function controllo(f) {
var nome=f.nome;
var email=f.email;
var richieste=f.richieste;
if (nome.value=="") {
alert("Nome è obbligatorio");
return false;
}
if (email.value=="") {
alert("e-mail deve contenere un indirizzo e-mail.");
return false;
}
if (!verEmail(email.value)) {
alert("Inserire un indirizzo e-mail corretto.");
return false;
}
if (richieste.value=="") {
alert("Richieste è obbligatorio.");
return false;
}
if (richieste.value.replace(/\s*/gi,'') == '') {
alert("Richieste è obbligatorio.");
return false;
}
if (richieste.value.replace(/\x13\x10*/gi,'') == '') {
alert("Richieste è obbligatorio.");
return false;
}
return true;
}
</script>
ma nn so se funziona o meno
http://forum.html.it/forum/showthread/t-664322.html

Rispondi quotando