Support

Account

Home Forums ACF PRO Dynamically creating field based on select value Reply To: Dynamically creating field based on select value

  • It is actually a similar question like this one: https://support.advancedcustomfields.com/forums/topic/generate-fields-for-each-select-option/

    I’m now down to the point where i need some kind of code to do this:
    If the radio button does not have choices when you edit the field group then you’ll need to create acf/prepare_field filters for each of these fields and dynamically create the conditional logic.

    What’s hard to grasp for me:
    The wysiwyg field needs to be different for every button group selection, but what about the field key? This needs to be the same every time?
    I understand the php export with the arrays but not how to code the conditional logic with the wysiwyg field.

    i.e.
    1) I select ‘button one’ from the button group in the product edit page.
    2) A wysiwyg field is show where i enter some value
    3) I select ‘button two’ from the button group and enter some value
    4) Echo this in the tab content (with just the_field('field_name');?