Menu

#52 Check maxlength for a Textarea

v1.6
open
Browser (30)
5
2007-03-20
2007-02-12
No

Unfortunately HTML doesn't enforce the maxlength attribute for TEXTAREA's.

Add a browser check to restrict the length for textareas, too.

Discussion

  • Patrick Wolf

    Patrick Wolf - 2007-03-20
    • milestone: --> v1.6
     
  • Patrick Wolf

    Patrick Wolf - 2007-07-04

    Logged In: YES
    user_id=1449836
    Originator: YES

    Check could be done with

    <textarea onKeyPress="return ( this.value.length < 50 );"></textarea>

    but onchange has also to be checked, in case the user pastes a text into the textarea, then the above check will not fire.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.