Galera,
I have the following problem,
I put this expression in JAVASCRIPT, it captures the amount of characters I typed and subtracts with MAXLENGTH, it works however I am using JSON (not to post on the page), when I click the Add characters button it continues number that I stopped typing, for example, I typed ALEXANDRE, it is 3991 characters, when I click Add, it should return to 4000, but it only returns when I start typing, I want it to return to 4000 in the button event, code ...
JAVASCRIPT:
$(document).on("input", "#DescricaoCadastro", function () {
var limite = 4000;
var caracteresDigitados = $(this).val().length;
var caracteresRestantes = limite - caracteresDigitados;
$(".caracteres").text(caracteresRestantes + " Caracteres");
});
HTML:
<label class="control-label col-sm-11 stf-alignright caracteres"><span>4000 Caracteres</span></label>