iForm

Scroll

Count Number of Multi-Paging Subform Records

There may be a time when you may want to count the number of Subform Records Created on a subform element.

To do this place the following code in the dynamic value of a text, number, or read only element:

my_parent_form.subform_element_in_parent.length

If your subform is nested inside another subform which is Single link use this:

my_parent_form.first_subform_element[0].nested_subform_element.length

If your subform is nested inside another subform which is Multiple link use this:

my_parent_form.first_subform_element[my_parent_form.first_subform_elemen.index].nested_subform_element.length

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

  • Avatar
    Hamish

    This is great. However - when there are no subforms this doesn't appear to evaluate and leaves the field blank. I need something that returns 0 when there are 0 subforms. Thanks

  • Avatar
    Hamish

    I've found that if (typeof myparentform.subformelementin_parent !== 'undefined') is a way to get around this....