[Solved] Calculate real-time javascript value and pass to input field, not textarea


Solved changing from document.getElementById (‘thingsID’). InnerHTML to document.getElementById (‘thingsID’).value

In Example:

function myCalc() {
var num1 = document.getElementById('WG_Collected').value;
var num2 = document.getElementById('Proof').value;
var PG_Collected = parseFloat(num1) * parseFloat(num2)/100;
document.getElementById('PG_Collected').innerHTML = PG_Collected.toFixed(2);
}

document.getElementById("WG_Collected").addEventListener("change", myCalc, true);
document.getElementById("Proof").addEventListener("change", myCalc, true);

Change to:

function myCalc() {
var num1 = document.getElementById('WG_Collected').value;
var num2 = document.getElementById('Proof').value;
var PG_Collected = parseFloat(num1) * parseFloat(num2)/100;
document.getElementById('PG_Collected').value= PG_Collected.toFixed(2);//().value//
}

document.getElementById("WG_Collected").addEventListener("change", myCalc, true);
document.getElementById("Proof").addEventListener("change", myCalc, true);

solved Calculate real-time javascript value and pass to input field, not textarea