adding numbers
Hi,
i have 3 textboxes I am trying to add the numbers that will entered in those textboxes
Here is my code
It gives me an error saying
document.frm1.txt1.value is null or not an object
any idea
Code:
<input type="text" name="txt1" id="txt1" onblur="callcal();" value="0">
<input type="text" name="txt2" id="txt2" onblur="callcal();" value="0">
<input type="text" name="txt3" id="txt3" onblur="callcal();" value="0">
function callcal()
{
var gettxt1=document.frm1.txt1.value;
if(gettxt1=="")
{
gettxt1="0";
}
var gettxt2=document.frm1.txt2.value;
if(gettxt2=="")
{
gettxt2="0";
}
var gettxt3=document.frm1.txt3.value;
if(gettxt3=="")
{
gettxt3="0";
}
if(gettxt1=="" && gettxt2 =="" && gettxt3=="")
{
finaltotal="0"
}
else
{
finaltotal=parseInt(gettxt1) + parseInt(gettxt2) + parseInt(gettxt3)
}
}
todd2006, July 3rd, 2008 01:11 PM
Bookmarks