Support

Account

Home Forums ACF PRO Field Group – Conditional Select Field Values

Helping

Field Group – Conditional Select Field Values

  • Hi there,

    I’m trying to generate the post title based on some user input, rather than free-form – no problem thus far passing values to this.

    What I’m struggling with, is the correct approach to populating the title with select field choices as part of a field group.

    General structure is a field group of ‘selections’ which has 3 or possibly 4 select field values – which are all conditional (too many for if/else, I fear).

    Is there a way to grab it so that I can build a string based on:

    $selection_one = ‘whatever’s selected first’;
    $selection_two = ‘second selection value’;
    selection_three = ‘third selection’;
    (conditional) $selection_four = ‘fourth selection value’

    All of the above has conditional logic in play. But are all kept within the same field group.

    Many thanks in advance!

    Best, Tom.

  • …or if it would be a suitable alternative…

    Would it be possible to have a placeholder text field (or similar) that gets updated with the content of one or more of the select field values… the only way I can think to do this would be with JS, perhaps with an onchange value? It would then need to be limited to only those visible fields within the field group.

    Basically, I need a field that displays the current selection(s) of this group that can be displayed both in a page template and hopefully in the back-end custom post type’s edit.php. There’s too many conditional fields etc. to consider doing it field-by-field.

    To clarify, this is a field group, within a field group i.e. ‘Field Type’ is set as group.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.