Faloude Faloude - 1 year ago 172
PHP Question

SilverStripe character limit for TextareaField

There seems to be no

parameter for
as there are for

What's a good way to limit characters for

Answer Source

Faloude, try doing something like $yourTextarea = TextareaField::create('yourField')->setAttribute('maxlength', 15);

You can set attributes on a form field if there isn't a pre-defined method for it in SilverStripe in this way.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download