Support

Account

Forum Replies Created

  • I got this working.

    <form>
      <label for="inputField01">Employee #01:</label>
      <input type="text" id="inputField01" value="John Doe">
    </form>
    
    jQuery(document).ready(function($) {
    	$('#inputField01').on('input', function() {
    	  $('label[for="inputField01"]').text('Employee #01: ' + $(this).val());
    	});
    	$('label[for="inputField01"]').text('Employee #01: ' + $('#inputField01').val());
      });
    

    Hope this helps.

  • Hi Giulia, did you ever figure this out?

    Cheers, Brian

  • I’m facing a similar challenge and I’m wondering if you ever found a solution.

    My scenario:

    1. Options page #1: an ACTIVE repeater with the following fields
      • Product (text)
      • Date in (datepicker)
      • Date out (datepicker)
    2. Options page #2: a duplicate from [1] named ARCHIVE

    ARCHIVE has the exact same fields as above.

    After field [Date out] reaches a certain date, I want that specific row to be moved (or copied) from the ACTIVE to the ARCHIVE.

    Hope I make sense.

    Thanks in advance!

  • Thanks for your solution. It definitely got me on the right track.

    My working solution with ACF Post Object (Multi Selection) looks like this:

    
    // Post Object variable
    // In my case a subfield, because it's in a group
    $acf_post_object = get_sub_field('acf_post_object');
    
    // Get the ID of the Post Object
    $featured_img_id = get_post_thumbnail_id( $acf_post_object[0]->ID );
    // Get the URL of the Post Object's featured image
    $featured_img_url = wp_get_attachment_image_url($featured_img_id, 'thumbnail' );
    
    // Use the url
    echo $featured_img_url;
    
  • This reply has been marked as private.
  • Thanks for your reply. I figures it out. I concentrated solely on the load_field code and not on the Options Page, which is mandatory.

    For those struggling, add this to your functions.php

    if( function_exists('acf_add_options_page') ) {
    	
    	acf_add_options_page();
    	
    }

    and add your source data there.

  • function acf_load_field_choices( $field ) {
        
        // reset choices
        $field['choices'] = array();
    
        // if has rows
        if( have_rows('ACFG01-F01', 'option') ) {
            
            // while has rows
            while( have_rows('ACFG01-F01', 'option') ) {
                
                // instantiate row
                the_row();
                
                
                // vars
                $value = get_sub_field('ACFG-F01-SOURCE');
                $label = get_sub_field('ACFG-F01-SOURCE');
    
                
                // append to choices
                $field['choices'][ $value ] = $label;
                
            }
            
        }
    
        // return the field
        return $field;
        
    }
    
    add_filter('acf/load_field/name=ACFG-F01-TARGET', 'acf_load_field_choices');

    Anyone?

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