Support Forum
I have a simple form where I need to multiply 3 the values in 3 fields, and then display the result in a 4th field.
Field IDs
Type: Number; ID = "total_number_guards"
Type: Number; ID = "shift_hours"
Type: Number; ID = "propposed_rate"
Type: Number; ID = "proposed_cost" <= This is where I want the calculation to appear
This is my code - which is not working:
function updateCost(){
var n = parseInt(document.getElementById("total_number_guards").value);
var h = parseInt(document.getElementById("shift_hours").value);
var r = parseInt(document.getElementById("proposed_rate").value);
var subtotal = n*h*r;
document.getElementById("proposed_cost").value=subtotal;
}
Any suggestions?