1
in which personal names wanted to leave it but organized, I have a script in which leaves the first uppercase letters of the name, but it does not ignore those of, dos, das, da etc, I wondered if it is possible to add this exception to the script!
function c(id) {
var letra = document.getElementById(id).value;
letra = letra.split("");
var tmp = "";
for (i = 0; i < letra.length; i++) {
if (letra[i - 1]) {
if (letra[i - 1] == " " || letra[i - 1] == ".") {
letra[i] = letra[i].replace(letra[i], letra[i].toUpperCase());
}
} else {
letra[i] = letra[i].replace(letra[i], letra[i].toUpperCase());
}
tmp += letra[i];
}
document.getElementById(id).value = tmp;
}
<input onkeyup="c('input-1')" required class="inp_editar" type="text" name="nome_cont" id="input-1"/>
Obg!
Dei an answer about it. To prevent making large letter short words you need a list of them. You have a list?
– Sergio
basically it’s just the, the, and, the, the
– JASL