Home › Forums › Add-ons › Repeater Field › Trying to get values from nested repeater in admin area › Reply To: Trying to get values from nested repeater in admin area
The code I originally posted was not 100%, I missed an error when copying your original code
add_action('wp_ajax_email_sender', 'email_sender');
function email_sender($field) {
// move this to the top
$post_id = $_POST["post_id"];
if( have_rows('day_repeater', $post_id) ):
// loop through the rows of data
while ( have_rows('day_repeater', $post_id) ) : the_row();
$date = get_sub_field('date'); // I need values from this field
// LOOP FOR NESTED REPEATER FIELD
if ( get_field('accommondation') ):
// next line changed
while( have_rows('accommondation') ) : the_row();
$notes = the_sub_field('notes'); // I need values from this field
endwhile;
endif;
endwhile;
endif;
There isn’t really a way to get the specific row other than to get the values from that row using JavaScript and submit them as part of your ajax request.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.