I am using <h:inputTextarea maxlength="50" /> I already have a javascript inplace where it will read the maxlength and only allow 50 characters (in our example) it works fine with textarea but not with h:inputTextarea.
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
h:inputTextarea doesn’t support the maxlength attribute:
http://download.oracle.com/docs/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/h/inputTextarea.html
The html textarea element doesn’t have that property prior to html5 which is why it’s not supported. You can of course validate the length with a jsf validator to enforce the max size server side and as you are already doing use javascript to limit the input for those clients that support js.