djbuddhi Posted October 28, 2008 Share Posted October 28, 2008 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> function sumAll_1() { var reslultEID = document.getElementById("reslult"); reslultEID.value = parseFloat(document.getElementById("t1").value); } function sumAll_2() { var reslultEID = document.getElementById("reslult"); reslultEID.value = parseFloat(document.getElementById("t1").value) + parseFloat(document.getElementById("t2").value); } </script> </head> <body > <form name="form1" method="post" action=""> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <table width="316" border="1" align="center"> <tr> <td width="140">Num1</td> <td width="160"><input type="text" name="t1" id="t1" onKeyUp="sumAll_1();" onChange="sumAll_2();" ></td> </tr> <tr> <td>Num2</td> <td><input type="text" name="t2" id="t2" onKeyUp="sumAll_2();" ></td> </tr> <tr> <td>Result</td> <td><input type="text" name="reslult" id="reslult"></td> </tr> </table> <p> </p> </form> </body> </html> Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 28, 2008 Share Posted October 28, 2008 Did you have a question? If you are posting your code as an example of how that should be done, then I would sieriously disagree with that methodology. There's no validation and the results are improperly displayed in some instances. Quote Link to comment Share on other sites More sharing options...
djbuddhi Posted October 29, 2008 Author Share Posted October 29, 2008 in this form someone ask about the final total .i did not include any validations .if u want i can add that also.this is really silly queation 4 me... Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 29, 2008 Share Posted October 29, 2008 If someone asked for this solution, you should have posted it in that thread. Quote Link to comment Share on other sites More sharing options...
djbuddhi Posted October 29, 2008 Author Share Posted October 29, 2008 i misplaced the place .i already look at it but unable 2 find it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.