Select all checkboxes with jQuery issue

Hey guys,

I have this jQuery script ‘script.js’ that is supposed to select all checkboxes in a form. You can see the page here:

However it doesn’t work. There’s no errors in the code. It was working locally but when I uploaded the entire site to a new server it broke. I’m assuming it’s an issue with the path to script.js because other jQuery elements are broken that use the same script, for example the jQuery slider at the bottom of the page.

Any help would be much appreciated. Thanks. :slight_smile:

The problem is your currently two different releases of jQuery into the page one of which doesn’t support the .on() method because of how old it is, see the below for the line to remove

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
[COLOR="#FF0000"]<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script> <!-- REMOVE THIS LINE -->[/COLOR]

Thanks a lot Chris. I removed that line and now the slider at the bottom of page works! :slight_smile: Thanks!!! However, the select all on this page, http://datawatch.ze.com/advanced-search/ still does not work? Any ideas?

Currently the way the code is written it will never fire because the anchor never has a class of active, the following should fix the issue.

$($(this).attr('href') + ' input:checkbox').prop('checked', function() {
    return !$(this).prop('checked');
});

Thanks again Chris! You’re awesome!