Home Forums ACF PRO How to display sub_field in a CF7 form


How to display sub_field in a CF7 form

  • Hi there,

    I would like to retrieve fields from a repeater in a CF7 form. I do not know if it’s possible, but maybe someone could help me?
    The repeater is displayed at the front end in a table, and at the end of each line of the table a button to send a form. I use the modal of Bootstrap 4 to display this form.
    I use the cf7 shorcode in the template to display the form.
    I would like some of the fields displayed in this table to be displayed in the fields of the cf7 form.
    In order to properly identify from which row of the table, a user clicked to send a form.

    I saw this topic:

    But that does not seem to work with sub_field

    Thank you for taking the time to read me.

    If anyone can help me, in advance, thank you very much.

  • You can use sub fields from a repeater in a shortcode or in place that use a shortcode, but you need to use the full meta_key value of the sub field which looks like this: {$repeater_name}_{$row_index}_{$sub_field_name}
    row indexes start at 0

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.