Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

Controlling Checkboxes with JavaScript

By Will Bontrager
2005-06-29


Limiting the Number of Checkboxes

The demonstration has checkboxes representing six colors, and the user is asked to select up to three. If the user tries to select more than three, an alert box reminder is displayed.

The JavaScript is function CountChecks(). It scans each checkbox to determine whether or not it's checked. If more than three checkboxes are checked, it

  1. Unchecks the last one that was checked by the user, and then

  2. Displays the alert box.



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

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources