title: insert field with cr/lf
body: <p>How do I handle this situation.</p>
  
  <p>I have a mysql backend that contains a field that is, let's say, 40 characters long.</p>
  
  <p>I have a textarea form field that I have set to maxlength="40"</p>
  
  <p>I have implemented some jquery code that counts the characters as you type them.</p>
  
  <p>As I enter text I can see the character counter going down, showing me how many characters are left. When it reaches 0 I will have supposedly entered 40 characters.</p>
  
  <p>The problem is that the counter and the textarea maxlength checks are only counting the carriage return/line feeds as one character. If I fill the textarea, with any CR's, and I try to insert the text into mysql it, of course, chokes, because there are too many characters.</p>
  
  <p>Is there some kind of filtering I need to do when I write/read it to the DB? I don't want to just truncate the text at the max characters when I do the insert/update.</p>