Hello,
I’m using the post below :
https://github.com/Hube2/acf-dynamic-ajax-select-example/blob/master/dynamic-fields-on-relationship/dynamic-fields-on-relationship.js
wich was working well until i update ACF Pro to the new version.
I changed :
var myACFextension = acf.ajax.extend({
to
var myACFextension = acf.model.extend({
but this line is making a js error :
// set the ajax action that’s set up in php
data.action = ‘load_relationship_content’;
Thank you for your help
You should post these type of question in the issues over on the github repo, this is really not an ACF issue.
However, the ACF JS API was completely rewritten for ACF 5.7.0 and you will need to rewrite the JS used by the code you copied. I have done this for another of those examples and you can see the types of changes that need to be made there https://github.com/Hube2/acf-dynamic-ajax-select-example/blob/master/dynamic-select-example/dynamic-select-on-select.js
Hi John Huebner,
Thanks for this code, it works well!
I need a country > region > city group of fields so I have tried to use your code to get this done, but… no luck.
Would you be so kind to make a “tweak” of your code to make this that I (and suppose hundreds of people) need so bad, please? I think it shouldn´t be very hard but my ajax knowledge is very poor to make it work…
Thanks a lot and keep the goood work!
@corporatic While searching for a select2 issue I’m having, I came across this topic.
You might wanna know I have a plugin which loads countries/states/cities conditionally, plz see https://acf-city-selector.com