I have 4 TextBoxes on my form that I'm trying to add together to get a
grand total. Here is the code I'm using:
<SCRIPT LANGUAGE="JavaS cript">
<!-- Beginning of JavaScript -
function calcTotalPub()
{
var tempFed = +document.Form1['txtFedSup'].value;
var tempState = +document.Form1['txtStateSup'].value;
var tempCounty = +document.Form1['txtStateSup'].value;
var tempCity = +document.Form1['txtCitySup'].value;
document.Form1['txtTotalPub'].value = tempFed + tempState +
tempCounty + tempCity ;
}
// - End of JavaScript - -->
</SCRIPT>
After I type in a value into my txtFedSup TextBox and click out of it,
I receive the following error message: "
'document.Form1 .txtFedSup.valu e' is null or not an object "
I have a number typed into the txtFedSup field and I also have the
number zero typed into the remaing TextBoxes as a default value, but
I'm still receiving this null error message.
Can anyone tell me what I'm doing wrong? I'm not very experienced
with JavaScripts.
Thanks,
C.R. Junk
grand total. Here is the code I'm using:
<SCRIPT LANGUAGE="JavaS cript">
<!-- Beginning of JavaScript -
function calcTotalPub()
{
var tempFed = +document.Form1['txtFedSup'].value;
var tempState = +document.Form1['txtStateSup'].value;
var tempCounty = +document.Form1['txtStateSup'].value;
var tempCity = +document.Form1['txtCitySup'].value;
document.Form1['txtTotalPub'].value = tempFed + tempState +
tempCounty + tempCity ;
}
// - End of JavaScript - -->
</SCRIPT>
After I type in a value into my txtFedSup TextBox and click out of it,
I receive the following error message: "
'document.Form1 .txtFedSup.valu e' is null or not an object "
I have a number typed into the txtFedSup field and I also have the
number zero typed into the remaing TextBoxes as a default value, but
I'm still receiving this null error message.
Can anyone tell me what I'm doing wrong? I'm not very experienced
with JavaScripts.
Thanks,
C.R. Junk
Comment