title: Enable a text box only when 1 of the radio button is clicked
body: <p>I have 2 radio button ie yes and no. When I select yes the text box as to get enabled. When i click no the text box as to be disabled. How to enable the text box when I click on Yes. Here is the code. Please tel me how to enable and disable it using javascript.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function() {
  
      $("#XISubmit").click(function(){
  
          var XIyop= document.forms["XIForm"]["XIyop"].value;
          var XIForm = $('form[name=XIForm]');
          var XIAlmnus = XIForm.find('input[name=XIAlmnus]:checked').val();
  
          if (XIAlmnus == null || XIAlmnus == "") 
          {
              alert("Please select  Parent is an Alumnus (old Boy) of this school");
              return false;
          }
          document.getElementById("XIForm").submit();
      });
  &lt;/script&gt;        
  
  &lt;!-- html code--&gt;
  &lt;html&gt;
  ...
  &lt;label&gt;Parent is an Alumnus (old Boy) of this school &lt;/label&gt; &amp;nbsp&amp;nbsp
  &lt;input type='radio' name='XIAlmnus' value='Yes' id="XIyes"/&gt;Yes
  &lt;input type='radio' name='XIAlmnus' value='No' id="XIno"/&gt;No&lt;/td&gt;
  
  &lt;label&gt;If Yes, Year of passing &lt;/label&gt; &amp;nbsp&amp;nbsp
  &lt;input type="textbox" name="XIyop" id="XIyop" &gt;
  ...
  &lt;/html&gt;
  </code></pre>