Support

Account

Home Forums Add-ons Repeater Field Using acf/load_field/key=field_#######

Solving

Using acf/load_field/key=field_#######

  • This is complicated (in my eyes at least).
    Latest version of ACF Pro, Latest WP.

    I am using a repeater to display a select list of dynamic values that controls the second select in the same row which also loads dynamic values based on the first selection.

    The issue is that using acf/load_field/key=### is that it changes all the fields and not just the one. So I’ve overcome that with JS by selecting the specific field on change and finding its parent ID and then updating the values of the next select.

    The issue is that when I come back to the page to edit again, the field is empty again.

    -repeater
    — select1 (loaded from JSON result)
    — select2 (once select1 is changed, this loads from another JSON file. results populate DB as they should.)

    Once I go back to the page, select2 is empty again. I need to be able to load it BASED on the value of select1 but I cant seem to get the repeater index from within the function as it only uses the $field object.

    Help? Also email me if you can help but need more details.

  • I should probably also mention that I don’t have anything set in the select options in ACF at all because it’s all coming from the JSON files.

    And the –select2 options all come from different JSON endpoints in another application.

  • Any help here?

    I’ve a similar requirement but I’cant figure out how to pass first select value to ‘acf/load_field’ for the second value.

    Regards.
    C├ęsar

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

You must be logged in to reply to this topic.