Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Email:

Controlling Checkboxes with JavaScript

By Will Bontrager
2005-06-29


Totaling the Value of Checked Checkboxes

The demonstration has checkboxes representing four items, with prices ranging from 0.00 to 55.00. There is also a text field. That text field is automatically updated with the total values of all checked checkboxes, every time one is checked or unchecked.

The JavaScript is TotalCheckedValues(). It does the following actions:

  1. Scans each checkbox to determine whether or not it is checked,

  2. Adds each checked value to a running total,

  3. Formats the total into a currency decimal number, and

  4. Displays the total in the form's text field.



Tutorial Pages:
» Controlling Checkboxes with JavaScript
» Limiting the Number of Checkboxes
» Totaling the Value of Checked Checkboxes
» Checking or Unchecking a Group of Checkboxes
» "All" and "None" Checkboxes


Copyright 2004 Bontrager Connection, LLC


 | Bookmark
Related Tutorials:
» JavaScript Debugging Techniques with Firebug
» Striped Tables Using JavaScript
» Opening PDFs in a New Window with JavaScript
» Essential Javascript -- A Javascript Tutorial
» Submit Forms Conditionally using JavaScript
» How to Setup a Randomising Function