Support

Account

Home Forums Add-ons Repeater Field Load Select Post Subfields on Repeater Reply To: Load Select Post Subfields on Repeater

  • John! You are my darling! 🙂

    But this doesn’t work :/

    var row = $(this).closest('.acf-row');

    var other_field = row.find('[data-key="field_5e7c9ad82e9d0"] .acf-input input')

    I change my code to:

    jQuery(document).ready( function($) {
        var valueCheck;
        $('[data-key="field_5e7c9a8b2e9ca"] .acf-row [data-key="field_5e7c9ad82e9cc"] .acf-input select').on( 'change', function () {
             valueSelect = $(this).val();
             if ( parseInt ( valueSelect ) > 0 ) {
            $.ajax({
                type: 'POST',
                url: '/wp-admin/admin-ajax.php',
                data: {
                    action: 'proprice',
                    value: valueSelect
                }, 
                error: function (data) {
                    console.log(data);
                }, 
                success: function (data) {
    
                   console.log(data);
                   if ( data == '') {
                      $('[data-key="field_5e7c9ad82e9cd"] .acf-fields [data-key="field_5e7c9ad82e9d0"] .acf-input input').val( '<span>Bu #id: ' +  valueSelect + ' ye ait bir içerik bulunamadı.</span>' );
                   }
                   else {
                      $('[data-key="field_5e7c9ad82e9cd"] .acf-fields [data-key="field_5e7c9ad82e9d0"] .acf-input input').val( data );
                   }
    
                }
        });
             }
        });
    });

    I’m sorry about that but my javascript language is too bad 🙂

    var row = $(this).closest('.acf-row');

    var other_field = row.find('[data-key="field_5e7c9ad82e9d0"] .acf-input input')

    Where should I add these codes?