Use the maxLength property, this will only limit user input, you can still assign as much text as you want via code.