Home › Forums › Add-ons › Repeater Field › Would like my repeater field to be read-only › Reply To: Would like my repeater field to be read-only
Hey @keithlock ,
I’m jumping in here 5 years later because I discovered a glitch (maybe a JS conflict) while using the filter of your suggestion.
Have a repeater field with a few subfields, try setting those input fields ‘disabled’ by add_filter (or even using a jquery script loaded in admin from your theme).
Set a bunch of rows with dummy data into “hello world” post.
Now try to drag and switch places between two rows, and update your post: sometimes data are literally switched between rows, sometimes rows disappear at all.
Try also to start over, this time delete one row from top or middle of the group, and update post again: the row you chosed to remove is still there while the last one of the group has gone.
I made some tests and the glitch seems to stop when I stop keeping fields ‘disabled’.
I’d love to offer a brilliant solution as well, but I’m not skilled enough.
Have you got some suggestion how to solve this?
I just found out why that happened and how to avoid this behaviour, here:
https://support.advancedcustomfields.com/forums/topic/disabled-readonly-field-in-repeater/#post-68179
set the field to “readonly” (required to avoid weird reaction of ACF when trying to save a JS disabled input)
please note that disabled field are not saved and it is better to use radonly to keep your data
Hope this helps someone in the near future. 🙂
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.