Support

Account

Home Forums Add-ons Repeater Field Dynamically populate repeater subfields per row

Unread

Dynamically populate repeater subfields per row

  • Hello,

    I am facing the following issue, I’ve been stuck for hours, hopefully someone helps me out!

    I am using the acf_form to create posts.

    I have a repeater field that contains 2 select fields: manufacturer and model, which are connected with each other and are dynamically populated through json using prepare_field. After the page loads I am using javascript to dynamically populate the model select based on the manufacturer select, but would like to avoid it for the first time.

    So here is the question:
    – Is there any way to specifically target individual repeater rows or individual field names inside individual rows? Ideally I would use the prepare_field on each row individually, get the manufacturer of that row and populate based on the selection the [choices] for the model select field.

    – I have seen that if a repeater field has multiple rows it gets a name like: acf[field_5eeb35aec30c1][row-0][field_5eeb35dfc30c3] – which is essentially a naming convention like {repeater field key}-{row}-{select field key}. How can I target a select field using this name?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.