Home › Forums › Add-ons › Repeater Field › Dynamically set limit for repeater rows › Reply To: Dynamically set limit for repeater rows
There isn’t any way to do this using a single field because the repeater will contain all of the existing rows and trying to limit this number of rows will cause issues. There isn’t a way to have one repeater that can be use to add new rows without showing all of the rows.
To do this you would need to have 2 different fields, one repeater that is used in the admin and one that is used only on the front end.
You can put your second field into a different field group.
You can then specify the fields that you want to show when calling acf_form().
When the front end field is loaded then you can add an acf/load_field filter, check the number of rows in the “real” repeater and limit the front end repeater based on that number.
Then you create an acf/save_post filter. In this filter you transfer anything that’s in the front end repeater to the “real” repeater.
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 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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.