TheCandyman
Technical User
I'm trying to get a function to total amount values on blur of each input box. So it will total each value entered and then put the grand total in
Code:
function displ(cnt)
{
Tot = document.form1.(Amount && cnt).value;
alert(Tot);
Tot = parseInt(document.form1.Amount.value) + parseInt(Tot);
document.form1.Total.value = Tot ;
return true;
}
Code:
<tr>
<td align="right"><span class="count">1</span>
<input type="text" size="20" name="Name1" value=""/></td>
<td> <input type="text" size="15" name="Title1" value=""/>
<input type="text" size="15" name="Employer1" value=""/>
<input type="text" size="5" name="Amount1" value="0" onblur="return displ(1);" /></td>
</tr>
<tr>
<td align="right"><span class="count">2</span>
<input type="text" size="20" name="Name2" value=""/></td>
<td> <input type="text" size="15" name="Title2" value=""/>
<input type="text" size="15" name="Employer2" value=""/>
<input type="text" size="5" name="Amount2" value="0" onblur="return displ(2);" /></td>
</tr>
<tr>
<td align="right"><span class="count">3</span>
<input type="text" size="20" name="Name3" value=""/></td>
<td> <input type="text" size="15" name="Title3" value=""/>
<input type="text" size="15" name="Employer3" value=""/>
<input type="text" size="5" name="Amount3" value="0" onblur="return displ(3);" /></td>
</tr>