Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 JavaScript: Count the number of checked checkboxes in a form Jump to:  
Category: >> JavaScript >> Count the number of checked checkboxes in a form Bookmark and Share

<< lastnext >>

Snippet Name: Count the number of checked checkboxes in a form

Description: This is a javascript function that counts the number of checked checkboxes in a form.

Also see:
» Count the number of checked checkboxes...
» Format money as millions, billions, et...
» Pre-populated List of Countries
» Convert UK Dates To mySQL Format Dates
» Count capital letters in a string
» Calculate the difference between two t...
» RMAN: Format Directives
» USER - connection information
» USER - User Information 2
» USER Information
» USER lock account
» USERS: Lock and Unlock accounts
» SQL*Plus formatting
» Create string by formatting an amount ...
» Count words or terms
» Count rows in all tables
» List security related profile informat...
» REGR_COUNT
» Currency display formatting function
» Number Functions: COUNT
» Number Functions: COUNT (running count)
» Nicely Format File Size
» Flat file counter
» GET and POST variables in hidden form
» Toggle All Checkboxes on or off
» Find Worst Performing Indexes
» Format numbers to two decimal places
» Prevent the 'enter' key from submiting...
» Counting rows
» Output as Word Doc format

Comment: (none)

Language: JAVASCRIPT
Highlight Mode: JAVASCRIPT
Last Modified: April 11th, 2012

// this function returns the number of checkboxes 
// that are checked in a form
// pass in the name of the form as 'formname'
// pass in the name of the checkbox group as 'groupname'
 
FUNCTION countCheckboxes(formname, groupname){
   VAR totalChecked= 0;
   VAR max = formname.ckbox.length;
 
   FOR (VAR idx = 0; idx < max; idx++) {
      IF (EVAL("document." + formname + "." + groupname + "[" + idx + "].checked") == TRUE) {
      totalChecked+= 1;
   }
}
 
  RETURN totalChecked;
}
 
 


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 259 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?