0
The calculation I managed to do with Javascript, only that its output has to be in percentage.
<script>
var mb = document.querySelector("input[name=medidab]");
mb.addEventListener("keyup", calcImc, false);
function calcImc(){
var md_val = parseFloat(mb.value);
medidab = (md_val/50*100).toFixed(1);
if(!isNaN(medidab)){
document.querySelector("input[name=circunferenciabraco]").value = medidab;
}
}
</script>
And here’s the form, I put the value in one field and the value of the calculation already comes out in the other. Only it has to come out in percentage and I don’t know if it’s possible.
<div>
<input class="campo-form-c" type="text" name="medidab" placeholder="Medida do Braço" maxlength="5">
</div>
<div>
<input class="campo-form-c" type="text" name="circunferenciabraco" placeholder="Circunferência do Braço" maxlength="5"></br>
</div>
Bruno, it wouldn’t be a case of just doing
.value = medidab + '%';
? You can explain better if it’s not that?– Sergio
Hi Bruno, did you see the answer and comment here? That’s what you were looking for?
– Sergio