Auto Sum Checkboxes | JavaScriptSource

Auto Sum Checkboxes

Jay Rumsey Apr 4, 2008

General

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: $

Notes

Source Code

Paste this source code into the designated areas.

External file

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


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

(5 comments)

Thnxs

mani Sep 5, 2012

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

Sandy Dec 11, 2008

Awesome script and thanks for the personal help with my issues. Does what I need it to do.

Steve DeQuaker Nov 5, 2008

Your question is beyond the scope of these comments. You will need to post it over on [a href="http://www.webdeveloper.com/forum/forumdisplay.php?f=3"]the JavaScript forum[/a]. Thanks!

Lee Oct 31, 2008

Hi,[br /]I was trying to use this with radio buttons in lieu of check boxes, so only one button could be checked(survey question responses) but can't get it too work with a radio buttons. Have you tried it with radio buttons or know of a solution?[br /]thanks[br /]Kim

Kim Nisbet Apr 6, 2008