u can try the following.
code behind:
------------
t1.attributes.add("onkeypress","Calculate(this)");
t2.attributes.add("onkeypress","Calculate(this)");
Javascript:
------------
function Calculate(obj)
{
var val1 = document.getElementById("t1").value;
var val2 = document.getElementById("t2").value;
var val3 = val1 + val2;
document.getElementById("t3").value = val3;
}
|