title: How to enable and disable drop down list by selecting radio button in ASP.NET
body: <p>I want to create a page in which whenever i select a particular radio item, a drop down list should be enabled and if some other item it selected the drop down list should be disabled.</p>
  
  <p>This is my form script in ASP.NET</p>
  
  <pre><code>&lt;form id="ticketbooking" class="book-ticket" runat="server"&gt;
      &lt;asp:Label ID="mode" runat="server" class="label"&gt;Mode of Travel&lt;/asp:Label&gt;&lt;br /&gt;
      &lt;asp:RadioButton name="selector" ID="train" GroupName="travelmode" runat="server" value="tr"&gt;&lt;/asp:RadioButton&gt;
      &lt;asp:Label ID="forTrain" for="train" runat="server" class="label"&gt;Train&lt;/asp:Label&gt; 
      &lt;div class="check"&gt;&lt;/div&gt;
      &lt;asp:RadioButton name="selector" ID="air" GroupName="travelmode" runat="server" value="ar" OnCheckedChanged="air_CheckedChanged"&gt;&lt;/asp:RadioButton&gt;
      &lt;asp:Label ID="forAir" for="air" runat="server" class="label"&gt;Air&lt;/asp:Label&gt; 
      &lt;div class="check"&gt;&lt;/div&gt;&lt;br /&gt;
      &lt;asp:Label ID="airname" runat="server" class="label"&gt;Airline Name&lt;/asp:Label&gt;&lt;br /&gt;
      &lt;asp:DropDownList class="droplist" ID="airlist" runat="server" Enabled="false" Font-Size="20px"&gt;
          &lt;asp:ListItem&gt;Air India&lt;/asp:ListItem&gt;
          &lt;asp:ListItem&gt;Kingfisher&lt;/asp:ListItem&gt;
          &lt;asp:ListItem&gt;Jet Airways&lt;/asp:ListItem&gt;
          &lt;asp:ListItem&gt;Spice Jet&lt;/asp:ListItem&gt;
      &lt;/asp:DropDownList&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I have tried a few scripts as below but they wont work...</p>
  
  <p>Method 1:</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () {
          $('input[name="selector"]').click(function () {
              if ($('input[name="selector"]').is(':checked')) {
                  var radioValue = $("input[name='selector']:checked").val();
                  if (radioValue == "tr") {
                      $("#airlist").prop("disabled", true);
                  } else if (radioValue == "ar") {
                      $("#airlist").prop("disabled", false);
                  }
              }
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Method 2:</p>
  
  <pre><code>protected void air_CheckedChanged(object sender, EventArgs e)
  {
      if (air.Checked == true)
      {
          airlist.Enabled = true;
      }
      else
      {
          airlist.Enabled = false;
      }
  }
  </code></pre>
  
  <p>I tried both but its not working..when i click on the "Air" radio button the drop down list should be enabled..am i doing something wrong? need some suggestions please..i am still new to ASP.NET and not sure about how to work in this framework.</p>