Auto-Sum Form Boxes
General
This script will automatically total boxes in a form. Use it to keep a running total of quantites or prices in an order form.
Notes
- Created by: Jim Stiles
- Web Site: www.jdstiles.com
- Posted: May 13, 2005
Source Code
Paste this source code into the designated areas.
External file
Paste this code into an external JavaScript file named: autoSum.js
CSS
Paste this code into your external CSS file or in the <style> section within the HEAD section of your HTML document.
Head
Paste this code into the HEAD section of your HTML document.
Body
Paste this code into the BODY section of your HTML document


Leave a Response
(25 comments)thanks alot[br /]i was in need indeed for that scribt
Mark,[br /][br /]You would just need to add another variable to the calc() function (with a different name), and add it to the autoSumForm line. Then add another box in the form, using the same name you used in the calc() function.
You can find a script for that [a href="http://javascript.internet.com/forms/auto-sum-checkboxes.html"]here[/a]
You would add the "readonly" attribute to the input control, e.g.,[br /][br /]input class="right" readonly="readonly" type=text name="thirdBox"
how about sum of 3 form boxes?