2
Good afternoon guys, I’m having a little trouble inserting parentheses between acronyms of a field that I created. Follow my code:
function maiusculo(){
var quadro = document.getElementById("quadro").value;
quadro = quadro.toUpperCase();
quadrocorrige= "("+ quadro +")";
document.getElementById("quadro").value = quadrocorrige;
}
The user can enter the Parentheses, but can only exit only one pair, that is, if the user type the acronym RJ, the input corrects to (RJ)! But if the user types (RJ), javascript is putting ((RJ)).
I need the acronyms to be capitalized and between parentheses.
I didn’t understand your problem. You want this to be like a mask, or rather, run every time the user presses a key?
– Weslley C X Sardinha
@Weslleycxsardinha, like a mask
– Anderson Fidelis
You are using Jquery?
– Pedro Paulo
No @Weslleycxsardinha
– Anderson Fidelis