check/uncheck checkbox based on another checkbox
<p>I looked at item 4197593 How to check uncheck a checkbox based on another checkbox and copied the code from the demo to my webpage. When I open the page I get a java error - the yellow triangle bottom left hand corner.
The error only occurs when I add in this javascript:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function(){    //bind event to checkbox 

  $("input[type='checkbox']").bind('click', function(){
    var $t = $(this),         
    val = $t.val(),         
    key = val.charAt(val.length-1);      
    // check if element is checked     
    if($t.val() == 'la'+key &amp;&amp; $t.is(':checked')) {       
      $("#lists_"+key).attr('checked', true);     
    }     
    else if($t.val() == 'la'+key){       
      $("#lists_"+key).attr('checked', false);     
    }   
  }); 
}); 
&lt;/script&gt;
</code></pre>

<p>I am adding this to a php page:</p>

<pre><code>&lt;?php
include('header3.html');
$Fullname = $_SESSION['membername'];

include('connectdb.php');
?&gt;
*the above javascript is added in here*
&lt;style type="text/css"&gt;
</code></pre>

<p>Hope someone can help me here as I am not too bright on java.</p>
