Community Expert
February 23, 2024
Answered
Resize automatically the height of a field according to the number of lines
- February 23, 2024
- 1 reply
- 6371 views
Hi,
I am looking for resizing automatically the height of a field according to the number of lines with the fieldFull method.
Here is the script I tryed:
if (event.fieldFull) {
//app.alert("The text field is full.\rWe are going to increase its height to be able to continue typing.");
var nomChamp=event.target.name;
this.resetForm([nomChamp]); // Reset field to lose focus
var aRect=event.target.rect;
aRect[3]=aRect[3]-event.target.textSize*1.16;
event.target.rect=aRect;
event.change=event.changeEx;
this.getField(nomChamp).setFocus();
}
That works approximatly because I lose the focus of the field and I need to type on this field to continue typing... Is there a way to avoid that?
P.S.: The 1.16 line spacing ratio is used for the Helvetica font.

