Highlighted

Obtaining the Field Height for an Expandable Text Field

Avatar

Guest

27-06-2008

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?

Replies

Highlighted

Avatar

Guest

15-07-2008

Ariane,

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";

//app.alert(ht);



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!