Per il tuo caso il codice è:
codice:
<script Language="JavaScript">
<!--
function checa_formulario()
{
if (document.forms["form1"].domain.value == "")
{
alert("Inserisca il suo nome nel campo apposito!");
return (false);
}
else
{
if (document.forms["form1"].domain.value.length < 4)
{
alert("Ha inserito un nome troppo corto! Inserirne uno lungo almeno 4 caratteri.");
return (false);
}
}
return (true);
}
//-->
</script>
<form name="form1" method="post" onsubmit ="return checa_formulario(this)" action="topdog_whois.php">
<input type="text" name="domain" size="30">
<input name="submit" type="submit" value="check it">
<input type="hidden" name="option" value="check">
<input type="hidden" name="sme_form" value="1">
</form>
Ti assicuro che funziona perchè l'ho appena testato.
Nel codice precedente avevo scritto male length...