OK, ecco:
codice:
<script language="javascript" type="text/javascript">
<!--
function LunghezzaMax(commento)
{
if (commento.value.length > 255 && commento.value.length < 10)
{
alert("Inserire nel campo \"\Commento\"\nminimo 10 caratteri ed al massimo 255 caratteri.");
commento.value = commento.value.substring(0, 255);
}
}
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
else
countfield.value = maxlimit - field.value.length;
}
//-->
</script>
.......
<textarea name="commento" rows="5" cols="32"
onChange="LunghezzaMax(this)";
onKeyDown="textCounter(this.form.commento,this.form.remLen1,255);" onKeyUp="textCounter(this.form.commento,this.form.remLen1,255);">
</textarea>
Se scrivo così:
codice:
if ((commento.value.length > 255)&&(commento.value.length<10))
La pagina va in errore: previsto oggetto.
Grazie-