I believe that you are trying to use h to take a measurement--and I believe that h is only used to assign a value. It may be returning the minH or maxH or 0, depending--but what you are doing with h is assinging 0 to the property h.
h Determines the height of a given form design object.when used this way (copied from the F1 Help):
The fully qualified reference syntax expression of one of the following container XML Form Object Model objects: area, contentArea, draw, field, pageArea, subform.
A string representing the unit type of the return value. If left blank, the default unit type is points.
An integer representing a zero-based index value indicating the content area in which you want to obtain the object's height. If left blank, the default value is 0.
This parameter allows you to calculate the height of an object that is distributed across multiple content areas, such as pages. For example, if you want to find the height of a subform object that spans multiple content areas, you would use this parameter to enumerate the height of the subform in each of the content areas and add the totals together.
The example given:
// Returns the height of a single instance of TextField1
// Calculates the height of Subform1 across two content areas and displays
// the total in a message box.
var iHeight = xfa.layout.h(Subform1,"in",0) + xfa.layout.h(Subform1,"in",1);
I played around with it a little and couldn't get it to work--but I think this is the right direction. I'm not sure what event is used--it may be layout:ready.
You have got the solution for this issue? Can you please explain me. I want to get the height of a text field 'A' which has expand to fit property or the height of the subform which contains that text field 'A'(subform is set to "auto fit") . My requirement is to assign this text field 'A' height to another checkbox field. I want to have the same height for both text field and checkbox field after that text field 'A' is dynamically expanded.