I would like to multiply the values from two text boxes (txtBox1 should contain an Integer value, txtBox2 should contain a Float value) and place the result in a third text box. My code is below, but it doesn't work. The javascript function is called, otherwise it fails. Can someone please help me to code this correctly :\ ? Thank you
//the javascript function
function CalculateTotal(id1, id2) {
var txt1 = document.getElementById(id1);
var txt2 = document.getElementById(id2);
var total = txt1 * txt2;
document.getElementById("txtTotal").value = parseFloat(total);
}
//c# code, programmatically adding attribute
txtBox1.Attributes.Add("onBlur", "CalculateTotal('txtBox1, txtBox2')");