[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


onClick check all checkboxes

Posted on 1998-05-14
Medium Priority
Last Modified: 2008-02-01
How do I onclick of button, check all checkboxes on a form. (FYI form Name = sched)?
Question by:capoeira
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
LVL 28

Accepted Solution

sybe earned 200 total points
ID: 1278061
The code below works in NS3, haven't checked it with other browsers. You can't do it with a submit button, because this will submit the form. But in stead of the text between the <a href=...> and </a> you can use an image which looks like a button.

You can build in a check if a form element is a checkbox or not.
something like:
if (document.form1.element[i].type = "checkbox") {



function CheckThem() {
      i = 0;
      while (i < document.form1.length) {
            document.form1.elements[i].checked = true;
            i = i + 1


<form name="form1">
<input type="checkbox" name="a">
<input type="checkbox" name="b">
<input type="checkbox" name="c">
<input type="checkbox" name="d">
<input type="checkbox" name="e">
<input type="checkbox" name="f">
<input type="checkbox" name="g">
<input type="checkbox" name="h">
<input type="checkbox" name="i">
<a href="Javascript:CheckThem()">Check All Boxes</a>



Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question