Hi all,

I've got a problem with a joomla module i'm using for Virtuemart (dutch website).

At the website www.golfdigital.nl i'm using a comparison module (top left @ page in catalogue). You can select some product (vink 'Vergelijk') and they will appear in the comparison module at the top left. It works perfectly, besides the fact that some products doesn't show in the comparison module when you select them. If you select them and you'll refresh the page, the products will appear. There's a javascript piece that is responsible for adding/removing the products to the module.

The browser says there's one error (Uncaught TypeError: Cannot call method 'change' of null) in the website. An error in the javascript that's responsible for adding and removing products to the module.

The javascript code:

function compareMod(id){jQuery.getJSON("index.php",{option: "com_virtuemart",ajax_request:1,view: "cmod",task: "cMod",nosef: "1",product_id: id,format:"json"},function(json){if(json != null)jQuery.each(json, function(key, val) {jQuery("#mod_compareall").prepend("<div id='mod_compare_prod_" + key + "'>"+"<input type='checkbox' id='mod_prod_"+key+"' name='mod_compare_"+key+"' class='compare_checkbox mod_compare_checkbox' CHECKED/>&nbsp;" <?php if($showimage) echo '+ val.im'; ?>+"<a href='" + val.url + "'>" + val.name + "</a>"+"</div>");jQuery("#mod_prod_"+key).live("change",function(){if (this.checked){}else{compareRemove(key);hideItem(key);}});});});};

function compareRemove(a){jQuery.getJSON("index.php",{option:"com_virtuemart",product_id:a,ajax_request:1,task:"cRemove",nosef:"1",format:"json",view:"cremove"},function(b){})};

function hideItem(a){jQuery("#prod_"+a).attr("checked",false);jQuery("#compare_prod_"+a).hide(500);jQuery("#mod_compare_prod_"+a).hide(500).remove()};
Can somebody help me?

Thanks in advance!