Page 1 of 1

textbox Field Length

Posted: Thu Dec 01, 2016 9:36 am
by esdaled
Is there a way to control the field length of a textbox (number of characters which can be typed into) so that the user is autotabbed to the next field when a character is typed beyond the length?

It seems that the length of a textbox is linked to length of the bound value.

Due to the restrictions of external systems that we interface with, the length of a name field on a display field needs to be restricted based on the destination system. I can edit the length in the RPG code, but it would be nicer to also restrict the user input on the rich display file.

Re: textbox Field Length

Posted: Thu Dec 01, 2016 12:08 pm
by Glenn
As you discovered, the framework will stop you from typing past the length of the bound field. If you want to override that without effecting the bound variable you could put something like the below in the 'onfocus' event of your textbox. The example code will change the 'maxlength' attribute of the textbox to 5.

Code: Select all

this.maxLength = 5;
To get the "autotabbed" behavior you can use the 'auto tab' setting shown in the doc page below.
http://www.profoundlogic.com/docs/display/PUI/Auto+Tab

Glenn