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?
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’re excited to announce we've released Composer support for installing ACF PRO.
— Advanced Custom Fields (@wp_acf) January 31, 2023
🎉 #ComposerPHP fans rejoice!
✨ Please see the release post for all the details and full instructions. https://t.co/ebEfp61nlR
© 2023 Advanced Custom Fields.
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.