Hello, I would like to know if the conditional logic works across multiple rows in a repeater field.
What I need to achieve: 3 images with layering (top, middle and bottom).
How I was thinking of doing: A repeater field with an image field and 2 checkboxes (Top layer and bottom layer) with conditional logic that hides already selected checkbox.
I would like the specific layer checkbox to be disabled/hidden if that layer has been selected in a previous row.
I have tried but does not seem to work. Any ideas.
I have an example of how to do this with a single true/false field here https://github.com/Hube2/acf-dynamic-ajax-select-example/tree/master/unique-repeater-checkbox.
Thanks for the code.
I tried implementing it but it gives me this error:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in /home/iriscenti2016/public_html/2016/wp-includes/plugin.php on line 524
I think it is the “$this” in the add_action that causes it.
If I remove the array and leave only “unique_repeater_checkbox_enqueue_script” it does not give the error anymore and seems to work.
One last question, what should the “var $list” be if I have 2 fields?
Thanks for your time.
You must be logged in to reply to this topic.
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!
© 2022 Advanced Custom Fields.