Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes How to find Checkboxes? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to find Checkboxes?" Watch "How to find Checkboxes?" New topic

How to find Checkboxes?

Krishna Srinivasan
Ranch Hand

Joined: Jul 28, 2003
Posts: 1844

I want to iterate the checkboxes in form?
Is there any way to find the checkboxes in a form. like getting number of checkboxes in the form.

Krishna Srinivasan
Spring Tutorials, OCAJP Mock Questions, 400+ OCPJP Mock Questions
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
You can find many examples on the web, but here goes.

Using normal JavaScript (NB: I have not run this code):

Using jQuery:

More info at

[Blog] [Blogroll] [My Reviews] My Linked In
It is sorta covered in the JavaRanch Style Guide.
subject: How to find Checkboxes?
Similar Threads
Problem in request.getParameterValues()
Multiple checkboxes
retrieving users' bookmarks
Why is request.getParameterValues not working for me?
Checkbox issue