sir i have 7 text boxes .1st two take values from user and display the multiplication result on 3rd text box when it clicked.4th and 5th textboxes also take values and display the multiplication result in 6th text box when it clicked.now 7th textbox will display the addition result when it clicked.7th textbox takes the values from 3rd and 6th textbox. my problem is that i can not do the addition and cant display the result in 7th text box in html and jscript.plz help me.....i am attached the code...
<html> <script> function getText1(){ var in1=document.getElementById('in1').value; var in2=document.getElementById('in2').value; var tot1=parseInt(in1)*parseInt(in2); document.getElementById('tot1').value=tot1; } function getText2(){ var in1=document.getElementById('in3').value; var in2=document.getElementById('in4').value; var tot2=parseInt(in1)*parseInt(in2); document.getElementById('tot2').value=tot2; } function gt1(){ var in1=document.getElementById('tot1').value; var in2=document.getElementById('tot2').value; var gt1=parseInt(in1)+parseInt(in2); document.getElementById('gt').value = gt1; </script> <form> <input type="text"id="in1"/> <input type="text" id="in2"/> <input type="text" onclick="getText1()" id="tot1"/> <br> <input type="text"id="in3"/> <input type="text" id="in4"/> <input type="text" onclick="getText2()" id="tot2"/> <br> <input type="text" onclick="gt1()" id="gt1"/> </form> </html>
document.getElementById('gt1').value=gt1;(gt1instead ofgt).