Checkboxes won't get checked in the browser

Checkboxes won't get checked in the browser

Hi all,

I have a really weird problem. I update checkboxes (set them to true/false) through jQuery, and their "checked" attribute gets set (when I loop through it), but the checkbox state won't show in the browser. Has someone an idea what it could be??

Here is my code:

  1.  $(document).ready(function () {
  2.         
  3.         $('.search').find(":checkbox").each(function () {
  4.             var $this = $(this);

  5.             $this.change(function () {
  6.                 var ac = getCheckBoxClass(this);
  7.                 setCheckBoxesAC(ac, this);
  8.             });
  9.         });
  10.     });

  11.     function setCheckBoxesAC(assetClass, checkBox) {
  12.         var curChecked = $(checkBox).is(':checked');
  13.         switch (assetClass) {
  14.             case 'All':
  15.                 if (curChecked) {
  16.                     $('.search').find(":checkbox").each(function () {

  17.                         if (getCheckBoxClass(this) != assetClass) {
  18.                             alert($(this).attr('checked'));

  19.                             $(this).attr("checked", "checked");
  20.                         }

  21.                     });
  22.                 }
  23.         }
  24.     }

  25.     function getCheckBoxClass(checkBox) {
  26.         return $(checkBox).parent().parent().attr('title');
  27.     }

  28.     function getCheckBoxByClass(ac) {
  29.         var spanSelector = ':span[title=' + ac + ']';
  30.         return $('.search').find(spanSelector).find(':checkbox').attr('id');
  31.     }