What PGiessler posted is not entirely correct.
This would only change the amount of characters allowed in your DB Field. AFAIK this will not put any restriction on your TextField, therefore it would be possible to enter more than 20 characters, but only 20 would be stored in the Database.
To limit the characters on a TextField, pass the max number of characters as 4th parameter to the TextField Constructor. Eg.
new TextField('Banner1Title', 'Banner 1 Title', '', 20);
Having a look at the source or API Docs would help in these cases...
thank you for your post. Your approach is the right one. First of all you have to put restrictions on the textfield and then you can put this in the database. But I think, you doesn't need the restrictions in the database; at most for security reasons.