Support

Account

Home Forums Add-ons Repeater Field Add Class to Repeater Field w/ Checkbox Reply To: Add Class to Repeater Field w/ Checkbox

  • Hi @robertrhu

    Thanks for reaching out to us.

    As opposed to using a checkbox, I would recommend using a true/false field. This will return true if selected and thus you can display the selected sub_field.

    If you would like to make use of the display none, you may do it as follows

    <?php
    $selected = get_sub_field('field_name','option');
    $html =  "<div "
    if(!$selected)
    $html.='style = "display:none;"';
    $html.=">My FAQ content here </div>"; 
    ?>

    Hope this helps.