Ver Mensaje Individual
  #7 (permalink)  
Antiguo 04/09/2006, 09:58
Avatar de djreficul
djreficul
 
Fecha de Ingreso: julio-2006
Ubicación: Cork
Mensajes: 672
Antigüedad: 18 años, 8 meses
Puntos: 0
Yo uso éste para contar y a la vez no permitir q escriban más de la cuenta

Código HTML:
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}

<!--Ejemplo con textarea//-->
Quedan <input readonly type="text" name="remLen" size="3" maxlength="3" value="250"> caracteres.<br>
<textarea name="descripcion" cols="70" rows="5" id="descripcion" onKeyDown="textCounter(this.form.descripcion,this.form.remLen,250);"
  onKeyUp="textCounter(this.form.descripcion,this.form.remLen,250);"><textarea> 
Sobre tu codigo te falta una "t":

if (document.NuevaMemoria.countcharacters.value.lenght <= 500){

Saludos.
__________________
La muerte es un camino que todos debemos recorrer...