Home › Forums › Add-ons › Repeater Field › Populate select field with values from repeater field › Reply To: Populate select field with values from repeater field
Hi @davidjustin
Hmmm… I see.
I think the same code can still be used but with some extra tweaking.
You use Field A (sub field) to select a “House Model”, field B appears as a blank select becuase no AJAX is hooked up yet.
You save the page.
The page re-loads and you hook into the load_field hook for field B (sub field next to Field A). In this hook, you can load all the values of the repeater field (“Lots”) and loop through the rows. You want to find the current row so I would write some code to pick out the row number for the $field[‘name’] and use this to match the loop index. This will get you the current row. Then you can find the Field A value and go from there,
Pretty complicated stuff, but it is possible!
Cheers
E
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.