how to add a character limit to paragraph text field

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  0161jon 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #168173

    0161jon
    Participant
    Post count: 2

    Hello,

    please could someone help me with how to add a character limit onto a text paragraph field in my pod? I’m sure it’s something simple I just don’t really know what I’m doing. I need it to be 150 characters but obviously I can change that bit once someone shows me how to add a limit.

    Thanks!

    :)

    #168182

    0161jon
    Participant
    Post count: 2

    Hello,

    does anyone have any idea how to do this please?

    Thanks!

    #168184

    magi182
    Member

    You need to add a save helper to check the number of characters, and either trim, or refuse submission if the text is too long.

    While this isn’t exactly what you want, here is a display helper that you can import and set up to display only the first 150 characters. While it isn’t exactly what you are looking for, maybe it will get you started.

    http://podsframework.org/extend/packages/trim-text/

    #168186

    0161jon
    Participant
    Post count: 2

    Hi magi182,

    thanks that’s a great help, I had come across a similar thing that cut it at 128 characters. I couldn’t figure out how I can change the helper to change the number of characters though. How is this done please?

    thanks again!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Wordpress Cloud Hosting