title: How to make javascript work along with Ajax UpdatePanel
body: <p>I am trying to add validation on my form. I am using AJAX controls in my form fields.
  When I remove the Update panel and AJAX control, my validation starts working, but when keeping both the things together, my validation is not working. How could I make them work together?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      function Validate() {
          var QuestionTextArea = document.getElementById("ctl00_ctl00_cphBody_midbox_fvInsert_txtQuestion");
  
          varError = "";
          if (!IsTextBoxEmpty(QuestionTextArea, "\nQuestion Text Area  not be Empty.")) {
              alert(varError);
              document.getElementById("ctl00_ctl00_cphBody_midbox_fvInsert_txtQuestion").focus();
              return false;
          } return true;
      }
  &lt;/script&gt;
  
  
  
      &lt;asp:UpdatePanel ID="UpdatePanel2" runat="server"&gt;
              &lt;ContentTemplate&gt;
  
               &lt;asp:TextBox ID="txtQuestion" runat="server" MaxLength="1000" Columns="50" Rows="5" Style="width: 380px;
               float: none" Text='&lt;%# Bind("Description") %&gt;' TextMode="MultiLine" /&gt;
               &lt;AjaxControl:TextBoxWatermarkExtender runat="server" TargetControlID="txtQuestion"
                WatermarkCssClass="water" WatermarkText="Type your Question Here."&gt;
               &lt;/AjaxControl:TextBoxWatermarkExtender&gt;
  
  
             &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>When I removes ajax extender and Update Panel. My textbox gets validated and when using UpdatePanel. No javascript function created by me is called.</p>