i have a form field named ABC and i want to calculate its value and get the result at XYZ hidden field. I use rsform.
the calculation:
XYZ = ABC / 105 * 12
I don't have code knowledge please help in detail. Thank you!
i have a form field named ABC and i want to calculate its value and get the result at XYZ hidden field. I use rsform.
the calculation:
XYZ = ABC / 105 * 12
I don't have code knowledge please help in detail. Thank you!
The easiest way is to add an id
attribute to the form and hidden fields (the id
attribute is added the same way as you assigned the name
attribute) and:
document.getElementById('XYZ').value = document.getElementById('ABC').value / 105 * 12;
Update
A simple example:
<!DOCTYPE html>
<html>
<body>
<input type="text" id="ABC" value="10" />
<input type="text" id="XYZ" value="" />
</body>
<script>
document.getElementById('XYZ').value = document.getElementById('ABC').value / 105 * 12;
</script>
</html>