Is there a way to set the maximum characters users can enter in a textarea? (e.g. 1,000 character, ~200 words)
And as an aside, is there a way to search this forum?
there is no built in feature, I may add it to a future update, but here is a quick snippet which you can add inside a Javascript view on your form page to do just that:
document.getElementById('textarea_id').addEventListener('input', function() {
var maxLength = 1000;
var currentLength = this.value.length;
var remainingLength = maxLength - currentLength;
// Update the character count display
document.getElementById('charCount').textContent = remainingLength;
// Truncate the value if it exceeds the maximum length
if (currentLength > maxLength) {
this.value = this.value.slice(0, maxLength);
}
});
change "textarea_id" to the ID of your textarea element
Max,
For those of us who don't know what you mean by putting "javascript inside the page" a feature for max character length would be nice. It was in previous versions. And also adding a 'count down' would be equally as cool!!
Thank you for your consideration to this suggestion.
Best regards,
Donna
Hi Donna
Added to v8.0.50
Max,
I upgraded to the latest version and still do not see where the setting is for maximum characters for a text area.
Thank you,
Donna
Hi Donna
it's in the v8.0.50 update which has just been published now.
Max,
I had done the update but it didn't work. My version is still the old version.
Things are moving faster than I can keep up with. I'm still on Joomla 4.x and PHP 8.13.
Should I reinstall Chronoforms version 8???
I don't know why it is not giving me the update in my website.
Best regards,
Donna
Hi Donna
Just download the new file and install it OVER yours, do not uninstall
I love it!! Works great!!
Thank you so much Max!
Donna
You are welcome! 😊
