Support

Account

Home Forums Front-end Issues Comment in a repeater

Helping

Comment in a repeater

  • Hi everyone,
    I have a series of nested repeaters with different fields inside. One of these fields is a comment that the frontend user must be able to post. I created the form with only the ‘comment’ field, the value is recorded but:
    1. the comment created the first time, is repeated the same for all repetitions (in front-end)
    2. what is recorded in that field is not seen in the backend.

    This is the form:

    <?php
    
    acf_form_head();
    
    $feedback = get_field('feedback');
    
    if( !empty($feedback) ):
      
    acf_form(array(
    		'fields' => array('field_5f5273e9dadf9'),
            'post_title'    => false,
            'post_content'  => false,
      		'form' => true,
      		'html_before_fields' => '<h4>Come รจ andata la giornata?</h4>',
            'submit_value'  => __('Invia', 'acf')
        )); 
    
    endif;
    ?>
    
    <?php if( get_field('feedback') ) { ?>
    	<?php echo '<b>il tuo commento:</b> ' . get_field('feedback') ?>
    <?php } ?>

    My backend looks like this:

    post backend

    how can i make the comment not repeat over and over?

    thanks for your help!

  • I read this post https://support.advancedcustomfields.com/forums/topic/getting-instance-and-sort-of-id-of-repeater-field/ and the related ones and managed to get a unique id for each ‘day’ that is repeated.
    But how can I use this ID for the comment? how to make the comment bind to this id and not the post id?

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

You must be logged in to reply to this topic.