title: Disabling form element with jquery
body: <p>I am trying to use jquery to disable a form element once a check box is clicked, however it doesnt seem to be working. Can anyone see whats wrong?</p>
  
  <pre><code>$('name="globallyAddTime"').click(function() {
  if ($(this).attr('checked')) {
         $('name="addedQuantity[]"').attr('disabled', true);
      } else {
          $('name="addedQuantity[]"').removeAttr('disabled');
      }
  });
  </code></pre>
  
  <p>Here is a link to the jsfiddle</p>
  
  <p><a href="http://jsfiddle.net/pocockn/bwmv7/4/" rel="nofollow">http://jsfiddle.net/pocockn/bwmv7/4/</a></p>