Grazie, adesso funziona:
codice:<html> <head> <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."); } } 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> </head> <body> <form method="POST" action=""> <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> <input readonly type=text name=remLen1 size=3 maxlength=3 value="255"> <input type="submit" value="Invia" name="B1"> </form> </body> </html>

Rispondi quotando