I have a character limiter for just TEXT. Now I need the characters to be limited to only 2 (I want to make the user type the state, for example: PR, SP, RJ ...). How do I do it?
$(document).ready(function () {
$(".apenastexto").keypress(function (event) {
var inputValue = event.which;
if (!(inputValue >= 65 && inputValue <= 233) && (inputValue != 32 && inputValue != 0)) {
event.preventDefault();
}
});
$(".apenastexto").addClass("form-control");
});