jQuery Validation on check box click disable TextBox?
<p>Hi I am trying to get this JavaScript work for me.</p>

<p>Can any one help me with this.</p>

<p>When user clicks the Check box the next text box should disable,
if unchecked then enable.</p>

<p>selectors are working fine when I debug scrip in IE9 developer tool.</p>

<p>function is running fine as needed.</p>

<pre><code>&lt;input id="RefillNeeded10" name="RefillasNeeded" type="checkbox" value="true"&gt;
&lt;input type="text" size="5" id="RefillTB10," name="Refills"&gt;
</code></pre>

<hr />

<pre><code>$('input[type="checkbox"][name^="RefillasNeeded"]').click(function () {
var num = $(this).attr('id').replace("RefillNeeded", "");
if ($('input[type="checkbox"][id="RefillNeeded' + num + '"]').attr("checked")) {
  $('input[type="text"][id="RefillTB' + num + '"]').attr("disabled", true);
                   }
  else {
  $('input[type="text"][id="RefillTB' + num + '"]').attr("disabled", false);
   }
 });
</code></pre>

<p>but <code>$('input[type="text"][id="RefillTB' + num + '"]').attr("disabled", true);</code>
this is not creating the attribute disable.</p>

<p>I have this listed <a href="http://jsfiddle.net/habo/KJVCa/1/" rel="nofollow">here</a> for convenience.</p>
