...
if (messaggio!= "")
{ alert(messaggio); return false; }
...
<form onsubmit="return convalida()">

ciao