H I O X INDIA
FREE Javascript
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Java Script Source
List All
Date & Time
Calendar
Stop Watch script
Slide Show
Image Effect
Mouse Effects
Color Picker Tool
Dynamic Color
Random Generator
Select All
Form Validation
Textbox Counter
Dynamic Form select
Bookmark
Window / User Info
Security / Authenticate
Status Bar
Title Bar
Cursor Position
Country List
Calculators
Delete Repeated Values
Alphanumeric
Free Games





AutoSum Generation JavaScript


About
This javascript will help you to generate the autosum when changes made in the checkbox.


Features
a) You can generate the sum when changes made in the checkbox using javascript
b) Simple and ease of use.
c) Just copy the code into your page and use it.


Preview

Value1
Value2
Value3
Result  
©hscripts.com


Code
Javascript
<!--Script by hscripts.com-->
<!--Copywrite of HIOXINDIA-->
<!--More scripts @ http://hscripts.com-->
<script language=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-->


HTML Code
<!--Script by hscripts.com-->
<form name="frm"> <table style="border:solid green 1px">   <tr><td>Value1<input type="text" name="txt"><input type="checkbox" name="chk1" onClick="app()"></td></tr>   <tr><td>Value2<input type="text" name="txt1"><input type="checkbox" name="chk2" onClick="app()"></td></tr>   <tr><td>Value3<input type="text" name="txt2"><input type="checkbox" name="chk3" onClick="app()"></td></tr>   <tr><td>Result<input type="text" name="txt3" READONLY></td></tr>   <tr><td align=center>&copy<a href="http://www.hscripts.com" style="color:#3D366F;text-decoration:none;cursor:pointer;font-size:13px">hscripts.com</a></td></tr></table> </form>
<!--Script by hscripts.com-->

Release Date - 07-04-2008

Get free version without ©copyright link for just 5



Usage
a)This script is useful for generating the autosum if you click the checkbox.
b)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 display in the result field.
c)To Set the values of textbox, just change the value of variables. Example: var a=10;//set value of first textbox. d)Copy the code into your page and use it.





License
- This javascript (misspelled as java script)/HTML code is given under GPL License
- i.e. Free use for those who use it as it is.
- Free, if your modification does not remove our copyright information and links.
- Detailed License information can be found here
- You can purchase the script if your requirements does not meet GPL License terms.


privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com

Others