Support

Account

Home Forums Backend Issues (wp-admin) Assigning a field in same group with result of Post Object

Solving

Assigning a field in same group with result of Post Object

  • Hi Folks,

    I’m still relatively new to ACF so be gentle if this has been asked before. I did try for over an hour to find a message similar to what I’m doing to no avail.

    I’ve got two fields a post object field which lists results from a custom post type and a second simple text field. I’d like the result of the selected row (from the post object) to act as the default input of the text field.

    I’m guessing there is some trigger that gets set when the user has selected a value from the post object but I can’t find it.

    I’ve looked at acf/fields/post_object/result but that doesn’t seem to be the place where I can assign the result value to a text field.

    Any guidance would be appreciated!

    Thanks

  • If you want to populate a field based on a selection in another field, there is nothing built into ACF that will do this.

    You must add custom JavaScript to ACF and create a JS action that fires when the select field is changed. Then you must do your own AJAX request to get the associated field from the post selected and populate the other fields value using the ACF JS API.

  • Thanks for your reply John! Is there an existing action in the API I could use?

    I’m really surprised that ACF doesn’t have this functionality built in. It is a common thing to do in a relational database.

    Thanks for steering me in the right direction!

    Markus

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

You must be logged in to reply to this topic.