0
Currently my fields are this way:
function formatar(mascara, documento) {
var i = documento.value.length;
var saida = mascara.substring(0, 1);
var texto = mascara.substring(i)
if (texto.substring(0, 1) != saida) {
documento.value += texto.substring(0, 1);
}
}
<form class="got" method="GET" action="diar.hist.php" name="troca" onsubmit="return verifica()">
<input type="text" maxlength="10" placeholder="Data" name="Data_dd" OnKeyPress="formatar('##/##/####', this)" />
<button class="css_btn_class" type="submit">Atualizar</button>
</form>
If the user type only the numbers, it completes perfectly with the bars, however if the user type letters or symbols he accepts in the same way. I wanted to limit the user to type only numbers and format in date format as the same type.
Caraca, perfect, meets what I want, thank you very much @Phelipe
– Geraldão de Rívia