Support

Account

Home Forums General Issues insert value of a custom field, based on another custom field Reply To: insert value of a custom field, based on another custom field

  • I have an example of doing this with a relationship field, unfortunately, it has not been updated to work with the new ACF JS API and will not work in the current version of ACF.

    What you have to do is to add an action on the relationship/post object field that triggers an AJAX request to get and populate the values in the other fields. As I said, this old example will not work, but it covers the basics https://github.com/Hube2/acf-dynamic-ajax-select-example/tree/master/dynamic-fields-on-relationship

    This example has been updated to work with the current version of ACF and shows the differences from the old code to the new code when it comes to making the AJAX request https://github.com/Hube2/acf-dynamic-ajax-select-example/tree/master/dynamic-select-example