function checkform(f) { if(f.nome.value == '') { alert('Insert your name and surname'); f.nome.focus(); return false; } if(f.email.value == '') { alert('Insert your email'); f.email.focus(); return false; } if(f.email.value.search(/^([\w\.\-])+@(([\w\-]{2,})+\.)+([a-z0-9]{2,})+$/i) == -1) { alert('Email format not correct'); f.email.focus(); return false; } if(f.richiesta.value == '') { alert('Inser a short description for your request'); f.richiesta.focus(); return false; } if(f.vericode.value != '') { alert('Insert the spam control code that appears in the red box below'); f.vericode.focus(); return false; } return true; }