title: disable enable textbox based on dropdown selection asp.net javascript
body: <p>Happy friday everyone! 
  I am trying to enable/disable textbox based on dropdown selection.
  If dropdown selected index == 0 then the textbox should be enabled, otherwise it should be disabled.
  Here is what I tried:</p>
  
  <pre><code> &lt;tr&gt;
                              &lt;td&gt;&lt;/td&gt;
                              &lt;td class="selection"&gt;
                              &lt;asp:dropdownlist id="ddlWindSpeed" onchange="HideTextBox(this);" runat="server" /&gt;
                              &lt;/td&gt;
                              &lt;td class="formField"&gt;
                                  &lt;asp:textbox id="txtActualWindSpeed" MaxLength="50" runat="server" /&gt;
                              &lt;/td&gt;
  </code></pre>
  
  <p>and here is the JS function:</p>
  
  <pre><code>function HideTextBox(ddlId)
              {
               var ControlName = document.getElementById(ddlId.id);
  
               if(ControlName.value == 0)  //it depends on which value Selection do u want to hide or show your textbox
               {
                   document.getElementById('txtActualWindSpeed').style.display = '';
  
               }
               else
               {
                   document.getElementById('txtActualWindSpeed').style.display = 'none';
  
               }
          } 
                          &lt;/tr&gt;
  </code></pre>
  
  <p>Using that I am getting this message:</p>
  
  <p><strong>SCRIPT5007: Unable to get value of the property 'style': object is null or undefined</strong> </p>
  
  <p>Any idea what am I doing wrong?
  Thanks, Laziale</p>