title: Change ASP Textbox Property with Javascript
body: <p>So I have this ASP.NET form which contains TextBoxtA and TextBoxtB. I want that if I enter certain input on TextBoxA (for example '000') the TextBoxtB text value would be set to 'TextChanged' and disabled. </p>
  
  <p>PS: And I want that happen right after the text di TextBoxA changes, not when onClick fired. So I use the attribute onTextChanged. According to this <a href="http://forums.asp.net/t/1300979.aspx" rel="nofollow">http://forums.asp.net/t/1300979.aspx</a>, I have to use onChange instead and change the poperty on PageLoad on my code behind. But it can't seem to work.</p>
  
  <p>So heres my code:</p>
  
  <pre><code>&lt;script runat="server"&gt;
      function changeText() {
          var A = document.getElementById('&lt;%=inputTexboxtA.ClientID%&gt;').value;
          var B = document.getElementById('&lt;%=inputTexboxtB.ClientID%&gt;').value;
  
          if (A = '000') {
              B = 'TextChanged';
          }
      }
  &lt;/script&gt;
  
  protected void Page_Load(object sender, EventArgs e)
              {
                  inputTexboxtA.Attributes.Add("onChange", changeText());
              }
  
  &lt;asp:TextBox ID="inputTexboxtA" runat="server" MaxLength="3"/&gt;&lt;/td&gt;
  &lt;asp:TextBox ID="inputTexboxtB" runat="server" MaxLength="3"/&gt;&lt;/td&gt;
  </code></pre>
  
  <p>Am I doing it right? Thanks before!</p>