Support

Account

Home Forums General Issues image selection and conditional logic

Solving

image selection and conditional logic

  • Hi all,
    I looked over internet to find an answer but didn’t find anything I could use in this case. I have 2 fields: the first one is an image selection field and the second one should show only when an image is selected. I can’t solve how to make proper rules in my conditional logic to ensure that the second field appears. Any tips will be greatly appreciated. thanks

    ...
    array (
                    'key' => 'field_51f23f8630b1a',
                    'label' => 'background image',
                    'name' => 'background_image',
                    'type' => 'image',
                    'instructions' => 'Select an image.',
                    'save_format' => 'object',
                    'preview_size' => 'thumbnail',
                    'library' => 'all',
                ),
                array (
                    'key' => 'field_5224663a0c8a2',
                    'label' => 'Opacity for background image',
                    'name' => 'opacity_for_background_image',
                    'type' => 'text',
                    'instructions' => 'slide it to change image opacity {0 = transparent, 10 = opaque}',
                    'conditional_logic' => array (
                        'status' => 1,
                        'rules' => array (
                            array (
                                'field' => 'field_51f23f8630b1a',
                                'operator' => '==',
                                'value' => '????',
                            ),
                        ),
                        'allorany' => 'all',
                    ),
                    'default_value' => 6,
                    'placeholder' => '',
                    'prepend' => '',
                    'append' => '',
                    'formatting' => 'none',
                    'maxlength' => '',
                ), ...
  • Hi @borisr

    Conditional logic only works for toggle fields – these are select / checkbox / radio fields.

    Conditional logic can’t be dependent on other fields such as image.
    However, I will add this in down the track

    Thanks
    E

  • I know the post is almost 4 years old, but are there any plans for this functionality? I’ve needed it several times as well.

    Great work Elliot!

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

The topic ‘image selection and conditional logic’ is closed to new replies.