title: Validation of textarea
body: <p>How to do I validate a textarea in a form? i.e, it should not be empty or have any new lines, and if so raise an alert.</p>
  
  <p>Code:</p>
  
  <pre><code>   &lt;script&gt;
      function val()
      {
        //ifnewline found or blank raise an alert
      } 
     &lt;/script&gt;
     &lt;form&gt;  
     &lt;textarea name = "pt_text" rows = "8" cols = "8" class = "input" WRAP &gt;&lt;/textarea&gt;
     &lt;input type=""button" onclick="val();"
      &lt;/form&gt;
  </code></pre>