how to set max character limit for textarea in zend like 300 characters

1k Views Asked by At

how to set max character limit for textarea in zend like 300 characters

1

There are 1 best solutions below

0
On

I don't think there is an easy way. If you assume HTML5 capabilities of the displaying browser you can use the inherited setAttrib method of the textarea to set the maxlength attribute. If you'd like to be more compatible you'll have to stick to a javascript solution. Both approaches are client side restrictions! You should always check the length when the form has been submitted.