Home › Forums › Front-end Issues › Show select value of dynamically populated menu › Reply To: Show select value of dynamically populated menu
The main problem you have is that you’re using an options page for your companies and there’s really no way to reliably get the company name without once again looping through your repeater and checking each row of the repeater to see if the company matches.
But then you have to think about what happens if you ever have to change the company name. This will cause the value that the user chose for company to not match anything.
A better plan would be to use a custom post type (https://codex.wordpress.org/Post_Types#Custom_Post_Types) for the companies and then you can use a post object field for the user to select a company. This would be much easier in the long run to manage and to code for.
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.