title: how to disable a button until a checkbox has been selected
body: <p>I am using checkbox which is displayed in a while loop. But i want to disable my remove button before any checkbox is checked.i am facing difficulty as i have stored checkbox name as an array. How to do that. my code is </p>
  
  <pre><code>&lt;form action="delete_mock.php" method="POST"&gt;
  &lt;table border="1" style ="width:100%"&gt;
  &lt;caption&gt;Mock Test Details of   &lt;span style="color:red;font-weight:bolder"&gt;&lt;?php echo $class_name_to_delete;?&gt;&lt;/span&gt;&amp;nbsp;Section&amp;nbsp;&lt;span style="color:red;font-weight:bolder"&gt;&lt;?php echo $section_name_to_delete;?&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color:red;font-weight:bolder"&gt;&lt;?php echo $school_name_to_delete;?&gt;&lt;/span&gt;&amp;nbsp; students&lt;/caption&gt;
      &lt;tr&gt;
      &lt;th&gt;Mock ID&lt;/th&gt;
      &lt;th&gt;Mock Name&lt;/th&gt;
      &lt;th&gt;No. of sections&lt;/th&gt;
      &lt;th&gt;Select to &lt;span  STYLE= "color:red"&gt;DELETE&lt;/span&gt;&lt;/th&gt;
      &lt;th&gt;Click to SHOW Questions&lt;/th&gt;
      &lt;/tr&gt;
      &lt;?php
          while($row = mysqli_fetch_array($result))
          {
          ?&gt;
  
              &lt;tr&gt;
              &lt;td style ="text-align:center;"&gt; &lt;?php echo $row['mock_id'];?&gt;&lt;/td&gt;
              &lt;td style ="text-align:center;"&gt; &lt;?php echo $row['mock_name'];?&gt;&lt;/td&gt;
              &lt;td style ="text-align:center;"&gt; &lt;?php echo $row['num_of_sections'];?&gt;&lt;/td&gt;
              &lt;td style ="text-align:center;"&gt; &lt;input type = "checkbox" class="checkbox" name = "todelete[]"  value = &lt;?php echo $row['mock_id'];?&gt;/&gt;&lt;/td&gt;
              &lt;?php
  
               echo '&lt;td style ="text-align:center;"&gt;&lt;a href = "pass.php?id='.$row['mock_id'].'" target ="_blank" style="text-decoration:none"&gt;SHOW&lt;/a&gt;&lt;/td&gt;';
              ?&gt;
              &lt;/tr&gt;
  
          &lt;?php
          }
      ?&gt;
  &lt;/table&gt;
  &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;
  &lt;input type="submit"id="removemock" value= "Remove"  name= "remove" STYLE= "font-weight: bold; color: white; height: 2em; background-color: #3778BD;position:absolute;left:680px"&gt;
  &lt;/form&gt;
  &lt;form action ="school.php" method="POST"&gt;
  &lt;input type="submit" value= "   Back   "  name= "backtable" STYLE= "font-weight: bold; color: white; height: 2em; background-color: #3778BD;position:absolute;left:600px"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Please help me ????</p>