I am unable to set the maximum length for a GWT TextArea. Could someone help me achieve this in GWT?
TextArea t1 = new TextArea();
t1.setMaxLength(300); // This method doesn't exist. How do I do this?
Gal's answer is right with just one correction :
t1.getElement().setAttribute("maxlength", "100");
The second parameter is a string. This worked for me.
You can set it as such:
t1.getElement().setAttribute("maxlength", "100");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With