Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new

Learn More

View all

Sign in to view all badges

Obtaining the Field Height for an Expandable Text Field



I'm trying to generate a "row" that has 4 fields which should all be the same height in order to create a "table" look. Trouble is I'm trying to obtain the field height on a field who's height is set to Expand to fit (since the size of the content will vary when data is bound to the form). The field returns 0in. as its height (since it's designed to grow as required).

I'd like to be able to determine my tallest field and then set all 4 fields to that height so that my row looks consistent.

Any ideas?





I had a similar need except that I only had one field in the group that could grow. But you should be able to modify the script below to do a comparison first to find the tallest fields. I use the following javascript in the Exit event of field that can grow:

var ht = xfa.layout.h(this,"mm");

var ht = ht+"mm";


this.parent.itemNum.h = ht;

this.parent.objClass.h = ht;

this.parent.costCode.h = ht;

this.parent.Qty.h = ht;

this.parent.Unit.h = ht;

this.parent.unitPrice.h = ht;

this.parent.Recd.h = ht;

this.parent.totPrice.h = ht;

I also have a reset button that clears the form. I had to manually reset all the row fields to the correct height in the click event of my reset button. Good luck!



Brilliant! Thank you!!

My mistake was checking this.h instead of xfa.layout.h