title: Textbox disables on postback
body: <p>I have a textbox and dropdown with items <code>All, abc, etc</code>. i wanted javascript code that disables the textbox when all is selected and enable it when anything else is selected. 
  <br /> I worked it out with that code but the issue is that if form is posted the textbox is disabled even when abc or anything else is selected.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function changeddl() {
          document.getElementById("txtsearch").disabled = document.getElementById("ddlcolumn").value == "All";
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>aspx</p>
  
  <pre><code>&lt;asp:DropDownList ID="ddlcolumn" runat="server" CssClass="ddl" Width="120px" AppendDataBoundItems="true" ClientIDMode="Static" ValidationGroup="Search" onchange="changeddl();" &gt;
      &lt;asp:ListItem&gt;All&lt;/asp:ListItem&gt;
      &lt;asp:ListItem&gt;abc&lt;/asp:ListItem&gt;
      &lt;/asp:DropDownList&gt;
  
       &lt;asp:TextBox ID="txtsearch" runat="server" CssClass="txt" Width="200px"
       ValidationGroup="Search" ClientIDMode="Static" SkinID="txt"&gt;&lt;/asp:TextBox&gt;
  </code></pre>