M
Michel
Hello,
I want to use a JS function to display the total of 3 textboxes in a
fourth one.
The page is built in VB.Net
The JS function is as follows:
function DoTotal_3A() {
var a = eval(document.getElementById("TB_1").value)
var b = eval(document.getElementById("TB_2").value)
var c = eval(document.getElementById("TB_3").value)
document.getElementById("TB_Result").value = a + b + c;
}
The call of the function is added to the textboxes in the page.load
event as follows:
TB_1.Attributes.Add("onkeyup", "DoTotal_3A();")
TB_2.Attributes.Add("onkeyup", "DoTotal_3A();")
TB_3.Attributes.Add("onkeyup", "DoTotal_3A();")
The function works correctly in FireFox/Chrome/Safari but displays an
error in IE. For information, I checked that the ID's used in the
function are indeed those used by the HTML output of the VB code.
I will appreciate your support,
Michel
I want to use a JS function to display the total of 3 textboxes in a
fourth one.
The page is built in VB.Net
The JS function is as follows:
function DoTotal_3A() {
var a = eval(document.getElementById("TB_1").value)
var b = eval(document.getElementById("TB_2").value)
var c = eval(document.getElementById("TB_3").value)
document.getElementById("TB_Result").value = a + b + c;
}
The call of the function is added to the textboxes in the page.load
event as follows:
TB_1.Attributes.Add("onkeyup", "DoTotal_3A();")
TB_2.Attributes.Add("onkeyup", "DoTotal_3A();")
TB_3.Attributes.Add("onkeyup", "DoTotal_3A();")
The function works correctly in FireFox/Chrome/Safari but displays an
error in IE. For information, I checked that the ID's used in the
function are indeed those used by the HTML output of the VB code.
I will appreciate your support,
Michel