Adjusting the height of a field at run time

The example demonstrates how to expand a field to match the height of the content in another field.

In this example, when the form filler types multiple lines in TextField1 and then clicks the Expand button, the height of TextField2 increases to match the height of TextField1.

To see this scripting example and others, visit the visit the Developer Center .

Scripting for the Expand button

The following script is for the Expand button:

    var newHeight = xfa.layout.h(TextField1, "in"); 
    TextField2.h = newHeight + "in";

// Ethnio survey code removed