limited number of characters input into the text box

How can I limit the number of characters that can be entered into a text box? For example, a maximum of only 4 characters can be entered into the text box

abcd

instead of 8 characters as shown below

abcdefgh

I don’t want to give the impression that the table will accept 8 characters when it will only accept 4.

You can do that by setting the size of the database field.

I think you can also use the format field for this, although I haven’t tried that yet.

I have tried setting the size of the database field to 4 and the text box still accept more than 4 characters. Sometimes I set the data provider of the text box as a variable instead of a database field. As the size of a variable cannot be set, the text box will simply accept many, many characters.

I don’t think setting a format for a text box will limit the number of characters in it. Format will determine the kind of thing you can enter in the text box, e.g. 1 or a or A or 12/03/2012.

In Foxpro we had the MaxLength property on a textbox…

Regards,

Hi,
You could use KeyListeners Plugin, Overview - KeyListeners Plugin - ServoyForge, to test how many characters a text box holds and act on that.

Regards,

Peter

There is already a feature request for this that you can watch/vote for: Jira

Thanks, Joas