title: how to make two mutually exclusive checkboxlists?
body: <p>I have made attendance sheet containing student's roll no, name,present and absent dynamically retrieved  from database.</p>
  
  <pre><code>&lt;?php
  $dbhost = 'localhost';
  $dbuser = 'root';
  $dbpass = '';
  $conn = mysql_connect($dbhost, $dbuser, $dbpass);
  if(! $conn )
  {
  die('Could not connect: ' . mysql_error());
  }
  $course=$_GET['id'];
  mysql_select_db('attendance');
  
  
   $sql = "SELECT student.sr_no, student.roll_no, student.name , mark_attendance.percentage FROM  student INNER JOIN mark_attendance ON mark_attendance.roll_no = student.roll_no     WHERE student.course_name Like '$course' ORDER BY roll_no ASC";
  
  
   $retval = mysql_query( $sql, $conn );
   if(! $retval )
   {
   die('Could not get data: ' . mysql_error());
   }
  
  while($row = mysql_fetch_array($retval, MYSQL_NUM))
  {
  
  print "&lt;tr&gt;"; 
  print "&lt;td&gt;" . $row[0] . "&lt;/td&gt;"; 
  print "&lt;td&gt;" . $row[1] . "&lt;/td&gt;"; 
  
   print "&lt;td&gt;" . $row[2] . "&lt;/td&gt;";
  
   echo "&lt;td&gt;" .  '&lt;input type="checkbox" name="present[]" value= "1"   /&gt;'.  "   &lt;/td&gt;";//checkboxes for present
    echo "&lt;td&gt;" .    '&lt;input type="checkbox" name="present[]" value= "0"  /&gt;'  . "&lt;/td&gt;";//checkboxes for absent
    print "&lt;td&gt;" . $row[3] . "&lt;/td&gt;";
  
  
  
  
     echo "&lt;td&gt;" . '&lt;input type="text" name="remarks" value= ""  /&gt;' .  "&lt;/td&gt;";
     print "&lt;/tr&gt;"; 
    }
  
     }
  
  
  
     mysql_free_result($retval);
  
     mysql_close($conn);
      ?&gt;
  </code></pre>
  
  <p>I want to make these two checkbox lists mutually exclusive means when I click on Present checkbox, its corresponding absent checkbox becomes empty and vice virsa.</p>