We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24665
    • 14 Posts
    I’m currently creating a new ModX template and I want to give a textarea a maximum length property. I was wondering if that is possible? If so, can someone please explain how?

    Thanks! smiley
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      There is no such attribute for a textarea. It can be done with javascript, though.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 24665
        • 14 Posts
        Ok, I’ve tried that already, but somehow it doesn’t work. I can get it to work in the HTML of the template, but not in the content management system itself. Do you maybe have a example for us?

        The thing is that we want a small content block with a maximum size, were the user can’t type any further than the content block is big. If the user now types further, it just doesnt show the extra text, but lets the user type endless stories. embarrassed
          • 9207 ☆ A M B ☆
          • 2,475 Posts
          This is a common problem in web apps... e.g. the database column is a VARCHAR(255), so it can only store 256 characters of data, but the HTML input will allow the user to type and type and type... the solution must lie in Javascript...