PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How to set maximum number characters typed into a Post Field?

  1. jhayes4
    Member

    i know i can change the size of the body post field, but Is there a way to limit the number words or characters that are typed into the field?

    I sometimes get people submitting posts that are far too long and i'd love to be able to set a maximum amount of characters. (and if there was a countdown to let them know they're getting close to their maximum, all the better!)

    Thanks

    Posted 13 years ago on Friday June 25, 2010 | Permalink
  2. This isn't currently built in functionality. Here is a forum thread that discusses how to implement it on your own:

    http://forum.gravityhelp.com/topic/limit-characters-in-paragraph-text-field

    Here is another thread where someone has implemented it themselves using jQuery:

    http://forum.gravityhelp.com/topic/single-line-text-max-length

    You wouldn't have a visible character counter but you could limit the amount of content with these types of customizations. They all use jQuery.

    Posted 13 years ago on Friday June 25, 2010 | Permalink
  3. There are other scripts out there that you can experiment with that do add the textarea limit along with a counter.

    Basic JS version..

    http://javascript.internet.com/forms/limit-textarea.html

    or nicer jQuery plugin

    http://roy-jin.appspot.com/jsp/textareaCounter.jsp

    I haven't tested them, but either should work just as well as the other ones Carl referenced with just a little work.

    Posted 13 years ago on Friday June 25, 2010 | Permalink
  4. jhayes4
    Member

    Thank you both very much for the update on this workaround!

    Posted 13 years ago on Friday June 25, 2010 | Permalink
  5. Do you think you might add this option in a future release? I really need the ability for several text boxes to have limits on total characters.

    Posted 13 years ago on Friday June 25, 2010 | Permalink
  6. Fred, yes, it's going to be added but it's still going to be a little further down the line. I know you've been itching for it.

    Check out the jQuery plugin I referenced above. It looks pretty sweet and fairly simple to implement.

    http://roy-jin.appspot.com/jsp/textareaCounter.jsp

    You can call the plugin file, then in your your page template or header file, set up the parameters for multiple fields. It looks like you can restrict by the number of words or characters and it even adds a nice counter so people know where they're at.

    If you need somebody to help implement something like that for you as an interim solution, I'd be happy to recommend a good developer.

    Posted 13 years ago on Friday June 25, 2010 | Permalink
  7. I would be interested in that, please email me.

    Posted 13 years ago on Saturday June 26, 2010 | Permalink
  8. Hey Fred, I emailed you the contact info. Good luck with it.

    Posted 13 years ago on Saturday June 26, 2010 | Permalink
  9. semrocc
    Member

    As a new user of Gravity Forms, I must say that this is a tremendous plugin. I was a little surprised that max characters wasn't an option in text fields, but I do look forward to when it is implemented.

    Keep up the great work!

    Posted 13 years ago on Saturday September 11, 2010 | Permalink
  10. As of version 1.4, the maxchar attribute can be set on standard text fields.

    screenshot

    We'll be adding character limit support for textareas, probably including a character count script as well in an upcoming version.

    Posted 13 years ago on Saturday September 11, 2010 | Permalink
  11. semrocc
    Member

    Thanks for the update Kevin...I just checked my post and I actually meant textareas...sorry for the confusion.

    Really looking forward to the release!

    Posted 13 years ago on Saturday September 11, 2010 | Permalink
  12. Haha. I'm actually looking for a minimum character restriction. Perhaps it would be best if you provided a range from minimum to maximum allowing either end to be open. I would like this for post body because in one case I have a problem where too little content is entered and in others, too much

    Posted 13 years ago on Thursday October 21, 2010 | Permalink
  13. drkenny
    Member

    Hi,
    I have just purchased and installed version 1.4.5.
    I see that max characters is present for single line text. Is it possible to do this for the field 'paragraph text'?
    Thanks,
    Kenny

    Posted 13 years ago on Saturday March 19, 2011 | Permalink