This javascript will help you to generate the autosum when changes made in the checkbox.
Features
You can generate the sum when changes made in the checkbox using javascript
Simple and ease of use.
Just copy the code into your page and use it.
Preview
Downloads
Javascript
<!--Script by hscripts.com--> <!--More scripts @ https://www.hscripts.com--> <script type="text/javascript"> var a=10; //set the value of first textbox. var b=20; //set the value of second textbox. var c=30; //set the value of third textbox. function app() { if(frm.chk1.checked==true) frm.txt.value=a; else frm.txt.value=0; if(frm.chk2.checked==true) frm.txt1.value=b; else frm.txt1.value=0; if(frm.chk3.checked==true) frm.txt2.value=c; else frm.txt2.value=0; var sum; if(frm.chk1.checked || frm.chk2.checked || frm.chk3.checked==true) { x=parseInt(frm.txt.value); y=parseInt(frm.txt1.value); z=parseInt(frm.txt2.value); sum=x+y+z; frm.txt3.value=sum; } else frm.txt3.value=0; } </script> <!--Script by hscripts.com-->
For customization of this script or any script development, mail to support@hscripts.com
Usage
This script is useful for generating the autosum if you click the checkbox.
The function app() is called to assign the value to the text box. If you click the checkbox the value will be assigned and then added. The result will be displayed in the result field.
To Set the values of textbox, just change the value of variables.