Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/05/2008, 08:31
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: contar caracteres al escribir

Hola fbirrer,

Si es posible hacerlo, y tienes que manejar el evento onKeyPress de tu textarea para contar los caracteres.

Un ejemplo:
Código:
Caracteres: <input id="total" type="text" name="total" />
<textarea id="comentario" name="comentario" onkeypress="cuenta();"></textarea>
<script type="text/javascript">
function cuenta() {
     var txt = document.getElementById( "comentario" );
     var total = document.getElementById( "total" );
     total.value = txt.value.length;
}
</script>
Saludos.

PD Traslado tu tema al foro de JavaScript.