Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/06/2013, 12:10
Avatar de LuisCZ
LuisCZ
 
Fecha de Ingreso: noviembre-2009
Ubicación: Maracaibo
Mensajes: 127
Antigüedad: 14 años, 5 meses
Puntos: 0
Respuesta: No cambia la variable con onFocus del textarea

Hola Rosencrantz, gracias por responder! estuve probando pero sigue sin funcionar . Lo coloque de esta manera:

Código:
$(document).ready(function() {
var limite = 500;
	$('#mensaje'+_nivel).on('keyup', function(event) {
		var longitud = $(this).val().length;
		var resto = limite - longitud;
		$('#totalcar'+_nivel).html(resto);
		if(resto <= 0){
			$('#mensaje'+_nivel).attr("maxlength", limite);
		}
	});
	$('#mensaje'+_nivel).on('keydown', function(event) {
		var longitud = $(this).val().length;
		var resto = limite - longitud;
		$('#totalcar'+_nivel).html(resto);
		if(resto <= 0){
			$('#mensaje'+_nivel).attr("maxlength", limite);
		}
	});
});