Home › Forums › General Issues › Display a text field based on a selected choice? › Reply To: Display a text field based on a selected choice?
That was my thought too but I can’t see any way for the logic to interact with the choices in the same field. As the categories are entered in the ACF admin interface it would ideally be something that is entered in the same field group as the choices, but there’s no obvious facility for adding additional fields to the Select field group.
I suspect the only way to accomplish this the way I envisage it would be to customise ACF on a coding level, to add in the ability to add additional fields and have them linked to each choice in the select choices field, so they would be there along with the default fields such as Default Value, Instructions, Field Label and Field Name etc. Probably the most efficient method would be to have a second : on each line in the Choices box, so the first item is the value, then the label, then the line of text (which could possibly just be a pointer to some other field that the user creates).
There’s possibly another way to get the same result, adding in those other text fields manually and then dragging out the field contents using some code in the WordPress functions or queries files. If I do this and get it working I’ll post my code here, just don’t hold your breath!
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βre excited to announce we've released Composer support for installing ACF PRO.
— Advanced Custom Fields (@wp_acf) January 31, 2023
π #ComposerPHP fans rejoice!
β¨ Please see the release post for all the details and full instructions. https://t.co/ebEfp61nlR
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.