--------------------------------------------------------
weebies - La lista su Web Design
e Web Development
http://www.weebies.com
--------------------------------------------------------

On Tue, 12 Jun 2001 13:37:14 +0200
"Ezio Ponari (libero.it)" <[EMAIL PROTECTED]> wrote:
  
>  oggi in ufficio mi sono scontrato con un problema riguardante il
>  campo textarea. Ho scoperto che non ha un attributo maxlength, come
>  il fratello maggiore text.
>
>  Come posso fare percio' per impostare un max di caratteri in input
>  all'utente?
>
>  Suggerimenti sia in html che in javascript sono ben accetti. :)

Se puo' esserti d'aiuto...

<html>

<head>
<script type="text/javascript">
function stop(testo) {
  if (testo.length >= 4) {
    testo=testo.slice(0,4);
    document.form1.text1.value=testo;
  }
}
</script>
</head>

<body>

<form name="form1">
<textarea name="text1" onkeyup="stop(this.value)"></textarea>
</form>

</body>
</html>

Ovviamente al posto di 4 puoi metterci la lunghezza che piu' ti aggrada
:]
byez

--------------------------
Estuans interius
ira vehementi 
Estuans interius
ira vehementi
Sephiroth
Sephiroth

--- weebies
-------------------------------------
puoi trovare questi ed altri interessanti interventi su
Wee-Forum, il nuovo forum online di Weebies
http://www.weebies.com/weebies2/forum.asp
-------------------------------------

Rispondere a