Home Forums Add-ons Repeater Field Get value of repeater post object in backend?


Get value of repeater post object in backend?

  • As you can see I have a repeater field that is pulling in a post objective (postage cost). This custom post type has a field called ‘postage_cost’. I need to be able to pull in that value to the number field (postage type value) as seen in the screenshot – how can I do this?

  • You will need to add custom JS to ACF. You will need to add a JS action that fires when the field changes. In this action you will need to make an AJAX request to get the value from the selected CPT and then update the text/number field.

    Targeting a sibling to update in a repeater based on the field that was changed

    // field_XXXXXX represents field to be updated
    // {INPUT TYPE} represents the field type of the actual field you will be updating
    field.closest('.acf-row').find('[data-key="field_XXXXXX'] .acf-input {INPUT TYPE}');
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.