title: JQuery not finding element
body: <p>I have a script with the following (only showing the applicable lines)</p>
  
  <pre><code>var setUploadDoneIndicator = function(form)
  {
      if ($(form).find('[id$=_upload_done_indicator]').is(':checked') == false)
      {
          console.log("Setting indicator");
          $(form).find('[id$=_upload_done_indicator]').trigger('click');
      }
  }
  
  var unsetUploadDoneIndicator = function(form)
  {
      if ($(form).find('[id$=_upload_done_indicator]').is(':checked') == true)
      {
          console.log("UnSetting indicator");
          $(form).find('[id$=_upload_done_indicator]').trigger('click');
      }
  }
  
  $('[id$=_upload_form]').each(function (event)
  {
      current_form = this;
  
      $(this).fileupload(
      {
          done: function (e, data)
          {
              setUploadDoneIndicator(current_form);
          }
      });
  }
  </code></pre>
  
  <p>This ticks a checkbox correctly, the idea is to listen on the checked state of the checkbox on another JS File. If I call unsetUploadDoneIndicator() right after setUploadDoneIndicator() in this script, it unticks the tickbox.</p>
  
  <p>Then in another JS file I have</p>
  
  <pre><code>$('#pricing_ab_upload_done_indicator').change(function()
  {
      if ($(this).is(':checked'))
      {
          console.log("got checked");
          unsetUploadDoneIndicator($('#pricing_ab_upload_form'));
      }
  });
  </code></pre>
  
  <p>Which calls the function in the first script, but does not untick the tickbox. I am unsure whether the pointer is passed over correctly, when printing out the received object in unsetUploadDoneIndicator() it does print out a JQuery object which seems correct, the </p>
  
  <p><code>if ($(form).find('[id$=_upload_done_indicator]').is(':checked')</code></p>
  
  <p>returns true, but the trigger does not happen, so i'm not sure if the element is actually found.</p>
  
  <p>If I change the second script with the following, the trigger to uncheck the box does not happen either</p>
  
  <pre><code>$('#pricing_ab_upload_done_indicator').change(function()
      {
          if ($(this).is(':checked'))
          {
              console.log("got checked");
              $('#pricing_ab_upload_done_indicator').trigger('click');
          }
      });
  </code></pre>
  
  <p>Why would the trigger not happen?</p>