I have 3 text fields that are allowed to have multiple lines: Field1, Field2, Field3.
Here is what I wanted to happen: everytime I enter data in any of the fields, the form should first compare the height of the 3 fields, get the tallest height among the 3, and finally, the height of the other 2 fields should copy the height of the tallest field.
I already have a script for this. I placed it in the exit event of all 3 fields. Here is the code for Field1:
//gets the height of the 3 fields
var myH = xfa.layout.h(Field1);
var myH2 = xfa.layout.h(Field2);
var myH3 = xfa.layout.h(Field3);
if (myH > myH2 && myH > myH3) //checks if Field1 has the tallest height
{
form1.SF2.Field2.h = myH + "pt";
form1.SF2.Field3.h = myH + "pt";
}
The code works fine but the problem is it only works on the field where i first entered data. For example, I entered 2 lines of data in Field1, the heights of Field2 and Field3 will adjust accordingly. But when I enter 3 lines of data in Field2, the height of all 3 fields are not adjusting.
Can you please help me how to resolve this?