2
Good afternoon guys, I have an expense code, I want an input form called "number kilometer" with display:one to appear only if in the expense field, is selected "Mileage". I removed the code to be more synthesized select options.
<select name="tipoDespesa" required style="margin-left:50px;">
\*várias opções aqui*\
</select>
<input type="number" name="numeroKm" placeholder="KM" id="km" step=".1" style="display: none; height: 30px;width: 70;padding-left: 10px;">
<input type="number" name="precoDespesa" placeholder="R$" id="valor" step=".01" required placeholder="Insira um valor!">
<script>
let ehQuilometragem = document.getElementsByName("tipoDespesa")[0]
if (ehQuilometragem == "Quilometragem"){
function adicionaCampoKm(){
$("#km").Show();
}
adicionaCampoKm()
};
</script>
I tried this script at the end but apparently did not get results.