Character limit on textarea

Is it possible to set a character limit on textarea fields in the Registration/Profile forms to prevent people (or bots) from entering excessive amounts of data?

Thanks.

Sure, but you’ll need custom code. I’d suggest using Parsley.

Thanks @KTS915.

I’ve done this before with my own forms but I was hoping there was some way to do this through s2Member. There are many options when adding fields to the registration/profile form. I thought there might be a setting for this somewhere.

I think that would be a useful feature addition if it’s not currently possible.

How would I add custom validation? Through the"Other Attributes" for a field?

“Other attributes” won’t work for that because they are just HTML attributes. You would need to enqueue a javascript validation plugin or library (like Parsley) and some custom JavaScript to make it work on the form.

Thanks again @KTS915

In my opinion, this should be built into the setup when adding a field.

Hmm, not sure I agree.

I have seen too many plugins become bloated and, ultimately, broken because the developer tried to cram too much into them. Adding more javascript is particularly problematic because it’s much harder to debug than PHP. You have only to look through this forum to see how many people have javascript problems. And those aren’t even caused by s2Member.