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:
<script type="text/javascript">
$(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 && $t.is(':checked')) {
$("#lists_"+key).attr('checked', true);
}
else if($t.val() == 'la'+key){
$("#lists_"+key).attr('checked', false);
}
});
});
</script>
I am adding this to a php page:
<?php
include('header3.html');
$Fullname = $_SESSION['membername'];
include('connectdb.php');
?>
*the above javascript is added in here*
<style type="text/css">
Hope someone can help me here as I am not too bright on java.
$isn't built-in function and is commonly defined in jQuery or such libraries.