function checkform(f) { if(f.nome.value == '') { alert('Insert your name and surname'); f.nome.focus(); return false; } if(f.telefono.value == '') { alert('Insert your telephone number'); f.nome.focus(); return false; } if(f.email.value == '') { alert('Insert your address'); 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('Insert a short description for your request'); f.richiesta.focus(); return false; } if(f.vericode.value != '') { alert('insert the control code that appear in the red box below'); f.vericode.focus(); return false; } return true; }