title: Empty the contents of a textarea after submit
body: <p>I have a comment box (textarea) inside a dialog. If the comment is successfully saved I want to clear the contents of the textarea and close the dialog box. ATM the dialog box will close but I need to wipe its contents.</p>
  
  <pre><code>&lt;textarea id="CommentBox" type="text" runat="server" rows="7" 
  maxlength="2000" /&gt; 
  
  if (CommentSuccessfullyUpdated == "TRUE") 
  {
  //empty the comment box??
  //something like
  $("#CommentBox").empty();
  
  //closes the dialog box
  $("#dialog").dialog('close');
  </code></pre>
  
  <p>Thanks for any replies</p>
  
  <hr>
  
  <p>Edit:
  Thanks for the help guys. It is running through the code but its not working. I think it has to do with in order to pick up the correct vales and resolve a biding issue I had to use:</p>
  
  <pre><code> function SubmitButton() {
              var commentBoxData = $('#&lt;%=CommentBox.ClientID%&gt;').val();
             }
  </code></pre>
  
  <p>When run through with a breakpoint returns:</p>
  
  <pre><code>function SubmitButton() {
              var commentBoxData = $('#ctl00_ContentPlaceHolder1_CommentBox').val();
  }
  </code></pre>
  
  <p>AND:</p>
  
  <pre><code>&lt;textarea name="ctl00$ContentPlaceHolder1$CommentBox" id="ctl00_ContentPlaceHolder1_CommentBox" type="text" rows="7" maxlength="2000"&gt; &lt;/textarea&gt; 
  </code></pre>
  
  <p>So Im guessing im not referencing the same textarea when I try to empty it.
  Also tried </p>
  
  <pre><code>$("#CommentBox.ClientID").val('');
  </code></pre>
  
  <p>but no joy....ay ideas?</p>