Validation of textarea

Posted by Hulk on Stack Overflow See other posts from Stack Overflow or by Hulk
Published on 2010-03-26T06:54:39Z Indexed on 2012/09/17 21:39 UTC
Read the original article Hit count: 207

How to validate a textarea in a form.i.e, it should not be empty or have any new lines and if so raise an alert

   <script>
    function val()
    {
      //ifnewline found or blank raise an alert
    } 
   </script>
   <form>  
   <textarea name = "pt_text" rows = "8" cols = "8" class = "input" WRAP ></textarea>
   <input type=""button" onclick="val();"
    </form>

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html