The code I have in working, but I cannot figure how to get the value in an input field, right now it works with a <p>.
function myFunction1583(e) {
var textType = Node.textContent ? 'textContent' : 'innerText',
hiddenValue1583 = parseFloat(document.getElementById('hiddenValue1583').value) || 0,
mathValue1583 = parseFloat(document.getElementById('mathValue1583').value) || 0,
changeValue1583 = document.getElementById('changeValue1583');
switch (document.getElementById('ValueChange1583').value.replace(/\s/g, '')) {
case '+':
changeValue1583[textType] = hiddenValue1583 + mathValue1583;
break;
case '*':
changeValue1583[textType] = hiddenValue1583 * mathValue1583;
break;
case 'Manual':
changeValue1583[textType] = '794.99';
break;
}
}
<input type="hidden" id="hiddenValue1583" name="hiddenValue1583" value="20" />
<input type="number" id="mathValue1583" name="mathValue1583" />
<select id="ValueChange1583" value="ValueChange1583" onchange="myFunction1583(event)">
<option disabled selected>-- Choose --</option>
<option value="*">Percentage</option>
<option value="+">Add</option>
<option value="Manual">Change to</option>
</select>
<p id="changeValue1583" name="changeValue1583">
</p>
I would like the data to fill an input so I can submit the info,