Codice PHP:
function controllaPWD()
{
var 
password=document.getElementById("campoPassword").value;
if(
password.length 6alert("mi prendi in giro? non lo sai che il minimo di caratteri è 6?");
else 
document.getElementById("idform").submit();

Un edit veloce veloce, ho levato il cancelletto.