1
Galley,
I have the following problem,
I built this expression in JAVASCRIPT, it captures the amount of characters I typed and subtracted with MAXLENGTH, it works but I’m using JSON (not to post on the page), when I click the Include button the characters I typed it continues from the number I stopped typing, for example, I typed ALEXANDRE, it gets 3991 characters, when clicking Include, it should return to 4000, but it only returns when I start typing, I want the event of the button it already goes back to 4000, follows the 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>
Could show the code you use by pressing Include?
– Filipe Oliveira
Alexandre, explains the question better by adding more details and the code of this handset of events.
– Sergio
Follow button code: <button type="button" class="btn btn-default" id="btnCasoSucesso">Include success case</button>
– AleBabaloff