title: Submit textarea form without a submit button with Enter key press
body: <p>Background: 
  I'm making a facebook wall-alike page, which will have many posts and you should be able to comment every post. So in this one page there are many forms (of course). And I only need to submit one of them.</p>
  
  <p>So yes, I have found answers to this question , but none of them work, so asking here:</p>
  
  <p>I got a form like this:</p>
  
  <pre><code>    &lt;form enctype="text/plain" action="submitcomment.php" method="post" target="output_frame" id="comment&lt;?php echo $prepare_data['post_id']; ?&gt;"&gt;
      &lt;textarea name="comment" id="comment" onkeypress="return submitViaEnter(event)" value="" autocomplete="off"&gt;&lt;/textarea&gt;
      &lt;input type="hidden" name="hiddenid" id="hiddenid" value="&lt;?php echo $prepare_data['post_id']; ?&gt;" /&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>and my JavaScript function looks like this:</p>
  
  <pre><code>function submitViaEnter(evt) {
      evt = (evt) ? evt : event;
      var target = (evt.target) ? evt.target : evt.srcElement;
      var form = target.form;
      var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
      if (charCode == 13) {
          document.forms[this.form.id].submit();
          alert("sent!");
          return false;
      }
      return true;
  }
  </code></pre>
  
  <p>If I use a textbox, it works, but when I use textarea, it is not working. Trying to press enter does nothing.</p>