Hi Sean,
There are number of ways you can get it done using your custom form and JS. First thing worth noting, is that your input field doesn’t actually pass a number as such, but a string. Golden rule is that you’d rather convert the input value to a number. Now, this can be done either pre-pending ‘+’ to your string result or forcing conversion by: Number() or using my preferred option: parseInt();
Also, when storing values it is far more convenient to use var(s) and then call them when needed…
Here is a sample mark-up for you:
input type="number" id="number" value="20" name="field1"
input type="number" id="points" value="" name="field2"
input type="number" id="result" value="" name="field3"
And simple JS example:
document.getElementById('points').value = 100; //setting my own input value
var y = parseInt(document.getElementById("number").value); //getting pre-populated input value
var z = parseInt(document.getElementById("points").value); //getting my pre-set input value
document.getElementById('result').value = y * z; // 'math' => calculating result and passing to a field
document.getElementById('result').readOnly = true; // setting a field to 'readOnly' - although I'd personally prefer .innerHTML = ?
// you can also,
// store your calculation in a var e.g.:
// var x = +y + +z; (converting with '+', instead parseInt(); expression)
// var x = y * z
// OR
// var x = parseInt(document.getElementById("number").value) * parseInt(document.getElementById("points").value);
// OR write a function for it...OR....
How you want to show submitted data in an email, is again your choice, really. You can use $ajax or keywords. I would personally use keywords on this occasion (check online manual for the detailed range), e.g.: “%response_#%” (*# = input name attr. value) or %question_answer_XXX% or %form_summary% and paste them in a form’s email body under submission action.
Hope that helps.