il codice l'ho trovato ma come posso integrarlo a questo che ho
gia' nella pagina?
quello che ho trovato e':
codice:
function checkMail()
{
var x = document.forms[0].email.value;
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(x)) alert('YES! Correct email address');
else alert('NO! Incorrect email address');
}
invece quello che ho gia' sulla pagina e':
codice:
<script>
function checkrequired(which){
var pass=true
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i]
if (tempobj.name.substring(0,8)=="required"){
if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
pass=false
break
}
}
}
}
if (!pass){
alert("Attenzione! dati incompleti per la registrazione")
return false
}
else
return true
}
</script>
scusatemi...