Support

Account

Home Forums ACF PRO Re-order of collapsed rows in the repeater field shuffles text

Helping

Re-order of collapsed rows in the repeater field shuffles text

  • I’m using ACF Pro on my site and I have a “products” repeater filed in the backend.

    Inside the repeater field, I have a few subfields and one of them is True/False if the product is not available anymore. And if that field is checked, there is a conditional logic that will hide all other subfields for that specific product.

    Then, when I have more products that are not available, and if I do the collapse of the products rows and do the re-order, the values of subfields for those products with a conditional logic will be shuffled.

    Is there any way how can I prevent/fix this?

    Thanks

  • It is not the collapsing of the repeaters that is causing this, it is the conditional logic that is hiding the fields.

    There isn’t any way to avoid this when using ACF’s conditional logic for sub fields in a repeater. The reason for this is that fields hidden by conditional logic are not submitted because the inputs are marked as “disabled” when hidden.

    This topic has been covered many times here. Here is one example.

    The easiest solution is to not use conditional logic for sub fields of repeaters. Is there any reason to hide the values other than not looking at them?

    Another more complicated solution is to write your own JavaScript code that hides/shows the fields based on the the value of the true/false field.

    There is a very old topic were Elliot (the original developer) provided code to alter the way ACF works. However, I have no idea if this still works as it was written for ACF version 4 and ACF has changed a lot since then. Given this there is probably a way to do this in the current version of ACF, but I do not know details of how that could be done.

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

You must be logged in to reply to this topic.