I' ve made this simple form which calculates the BMI from Height and Weight Variables. It works when i insert integers to Height and Weight variables respectively, but unfortunately it doesn't work the way it should when i insert decimal numbers.
Any thoughts on fixing this issue?
function Calculate() {
var manWeight = document.getElementById('manWeight').value;
var manHeight = document.getElementById('manHeight').value;
document.getElementById('manBMI').value = parseInt(document.getElementById('manWeight').value) / Math.pow(parseInt(document.getElementById('manHeight').value), 2);
}
<label for="manWeight">Weight: *</label>
<input type="text" name="manWeight" size="35" id="manWeight" required autocomplete="off">
<br>
<label for="manHeight">Height: *</label>
<input type="text" name="manHeight" size="35" id="manHeight" required autocomplete="off"> <br>
<label for="manBMI">BMI:</label>
<input type="text" name="manBMI" size="35" id="manBMI" required disabled autocomplete="off">
<button type="button" id="calculator" name="calculator" onclick="Calculate();">Calculate</button>