title: Limit chars per line in textarea
body: <p>I have a non-resizeable textarea. I need it to work as follows:</p>
  
  <p>When the user enters text, and they hit 76 characters, they should not be able to type anymore until they hit enter</p>
  
  <p>OR</p>
  
  <p>It should continue to the next line as a new line.</p>
  
  <p>I tried to process it post-submission, to add newlines every 76 chars, but it added too many spaces, and when I trimmed, got rid of required spaces.</p>
  
  <p>What's the fastest, most user friendly way to do this?</p>
  
  <pre><code>&lt;textarea class="edit_note_text"&gt;&lt;/textarea&gt;
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var text = $('.edit_note_text').val();</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.edit_note_text{
      overflow-y: auto;
      overflow-x: hidden;
      resize: none;
      font-size: 16px;
      font-family: Courier;
      padding: 8px 8px;
      border-color: #dcdcdc;
      color: #4e4e4e;
      margin: 10px 16px 0px;
      width: 780px;
      height: 160px;
          position: relative;
      box-sizing: border-box;
      -webkit-appearance: textarea;
      background-color: white;
      -webkit-rtl-ordering: logical;
      flex-direction: column;
      outline: none;
          cursor: text;
      white-space: pre-wrap;
      word-wrap: break-word;
      border-width: 1px;
      border-style: solid;
      }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;textarea class="edit_note_text" cols='76'&gt;&lt;/textarea&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have tried several ways of fixing this with CSS, but I don't think CSS is the answer. I thought of using Javascript on keyup, but there are ways around that. </p>