Ecco il codice htm e javascript:
-----------------------------------------------------------------------------------------
<html>
<script>
function manda(modulo)
{
var name = modulo.nome;
if ((name.length) < 6)
{
alert("Nome minimo 6 caratteri");
modulo.nome.focus();
}
else
{
modulo.action = "http://localhost:8080/servlet/HelloOne";
modulo.submit();
}
}
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>index</title>
</head>
<body>
<form name= "modulo" method="POST" onClick = manda(this);>
<input type="text" name="nome" size="10"><input type="submit" value="Invia" name="invia"><input type="reset" value="Reimposta" name="resetta"></p>
</form>
</body>
</html>
-----------------------------------------------------------------------------------------
Perche se inserico meno di 6 caratteri funziona lo stesso?Inoltre basta che appoggio il mouse sulla casella che subito invia dati. L'ho testato su firefox non da errori, ma all'atto pratico non fa quello che dovrebbe, qualcuno ha una spiegazione plausibile?