how to disable one checkbox when a user check one in multicheck box
<p>I have two checkboxes generated like this:</p>

<pre><code>  &lt;table&gt;
    &lt;?php foreach ($invited_members as $mem) : ?&gt;
        &lt;?php if ($mem['mc_role'] != 'c') : ?&gt;
                            &lt;tr&gt;
                                &lt;td style="width:40px;text-align:center"&gt; attend  &lt;/td&gt;
                             &lt;td style="width:40px;text-align:center"&gt;&lt;input name="p_members[]" id="p_members" type="checkbox"  value="&lt;?php echo $mem['member_id']; ?&gt;" &lt;?php if ($mem['mm_present'] == 1) echo 'checked="checked"'; ?&gt; &lt;?php if (!$this-&gt;isSupervisor or $meeting_info['meeting_status'] != 2) echo 'disabled="disabled"';?&gt; onclick="change(this,'#on_p_members');"/&gt;&lt;/td&gt;
                              &lt;td style="width:40px;text-align:center"&gt; E-attend  &lt;/td&gt;
                                &lt;td style="width:40px;text-align:center"&gt;&lt;input name="on_p_members[]" id="on_p_members" type="checkbox" value="&lt;?php echo $mem['member_id']; ?&gt;" &lt;?php if ($mem['mm_present'] == 2) echo 'checked="checked"'; ?&gt; &lt;?php if (!$this-&gt;isSupervisor or $meeting_info['meeting_status'] != 2) echo 'disabled="disabled"'; ?&gt;onclick="change(this,'#p_members');"/&gt;&lt;/td&gt;
                                &lt;td style="width:50px;text-align:center"&gt;&lt;img src="&lt;?php echo base_url() . 'avaters/' . $mem['mem_image']; ?&gt;" height="38" width="38" /&gt;&lt;/td&gt;
                                &lt;td&gt;&lt;?php echo stripslashes($mem['mem_real_name']); ?&gt;&lt;/td&gt;
                            &lt;/tr&gt;
        &lt;?php endif; ?&gt;
    &lt;?php endforeach; ?&gt;
                &lt;/table&gt;
</code></pre>

<p>I want when the user check on one of the them the other on disabled so i tired using jquery </p>

<pre><code>function change(p_members,x)
{


 if ($(p_members).attr('checked'))
     { 

         $(x).attr('checked',false);
         $(x).attr('disabled',true);

     }
     else 
         {               
              $(x).removeAttr('disabled');

         }
  }
</code></pre>

<p>But it didn't work correctly. When the user in the second row check one the checkbox, one of the checkboxes on the row before it is disabled. How can I solve this ?</p>
