VF component apex:inputTextArea
generates textArea
as underlying HTML. To support the maxlength attribute, you use HTML-5 pass-through attributes as documented here.
Here is a simple example (no controller extension required):
<apex:page standardController="Foo__c" doctype="html-5.0">
<apex:form >
<apex:commandButton value="save" action="{!save}"/>
<apex:inputTextArea value="{!Foo__c.bar__c}" html-maxlength="10" rows="2" cols="10"/>
</apex:form>
</apex:page>
The above assumes field bar__c
is of type textArea as per your problem statement
Notes
apex:page
requires adding attribute doctype="html-5.0"
- You 'pass through' the VF attribute
html-maxlength
to the underlying textarea HTML-5 maxlength
attribute