Jump to content

Maxlength of characters in a textarea field


dazzyweb
 Share

Recommended Posts

Hi

I am not sure if it is best to post here or general support but since i am still new to processwire I will post here.

Is it not possible to limit the Maxlength in characters that are allowed in a field with a Type of 'textarea'?

I see that this option is available if the field Type is 'text' but not if the field type is 'textarea'.

Is there a reason for this?

Link to comment
Share on other sites

Thanks for that adrian. Would be cool to have that included as default with processwire.

I noticed that there is an option Truncate Text. What is the purpose of this since the limit is already made with the max. characters and max words option. I can't seem to see what difference it makes ticking that option. Maybe I am missing something here.

Link to comment
Share on other sites

I actually haven't used the module, but I am assuming it will force any pasted text to be truncated, whereas the normal max characters maybe just prevents further typing. Here is a relevant post from Martijn: http://processwire.com/talk/topic/2343-char-counter-for-texttextarea-fields/?p=47468

Have a play around with it and see what happens :)

Link to comment
Share on other sites

Thanks adrian,

The advantage of the javascript truncated option is a visual response for the editor. He can see how many characters he has left. I wanted this for a Meta Description field. Also used it in an intro text telling 400 characters gives the best visuals, but 500 are allowed. Then when there are 100 to go. The editor knows it's looking good.

Truncate will truncate when the limit is reached, the unchecked option will revert to the old text previously inserted. 

  • Like 1
Link to comment
Share on other sites

Thanks for the responses.

I can still see how many characters are left even if the truncate option is unchecked.

After playing around with it for a while the only difference I seem to see is if I paste some text into the field and the truncate text option is checked then it cuts to the max character limit. If it is unchecked then it reverts back to old value if there was one before.

Link to comment
Share on other sites

  • 3 years later...
On 23.12.2016 at 3:33 PM, adrian said:

This functionality is now built into the core so you can use with ML textareas:

Screen Shot 2016-12-23 at 6.33.17 AM.png

Isn't that only available for the 3.x Branch? I am using 2.7.3 dev version. Sorry that I have forgot to say which version of processwire I use.

Link to comment
Share on other sites

Just now, Nukro said:

Isn't that only available for the 3.x Branch? I am using 2.7.3 dev version. Sorry that I have forgot to say which version of processwire I use.

Yes, I think you are correct that it's only in 2.8 and 3. Personally I would recommend upgrading. You are missing out on lots of great functionality. If it's a legacy site without much of a budget for maintenance go with 2.8. Otherwise go with 3.x - I have upgraded many sites from 2.7 to 3.x without any problems.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...