Auto Sum Checkboxes | JavaScriptSource

Auto Sum Checkboxes

Jay Rumsey Apr 4, 2008


As the user selects items in the form, this script will display a running total automatically. No need to keep reloading the page, and no surprises for your user at the check-out point. Easy to implement into your existing forms.

Game Order Form

Game 1 (  9.99)
Game 2 (19.99)
Game 3 (27.50)
Game 4 (45.65)
Game 5 (87.20)
Total cost: $


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: autoSumCheckboxes.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response


Can there be more than 10 checkboxes?

Ben Feb 17, 2013


mani Sep 5, 2012

Thanks for that code... nice

Rasel Apr 18, 2012

I have 58 checkboxes in different tables but in same form. Now how can I do the same thing your program is doing when clicking each checkbox and summing up its value?

Amras Apr 3, 2012

Thanks I was trying to get this accomplished but had several failed attempts with many fields.

Sandy Dec 11, 2008