Hopefully, you can help me with this one. I currently have a repeater field that holds 2 sub-fields, Note and User. I have managed to get the User field to populate with the current user exactly as I wanted it. I have also managed to get any User field to be disabled/readonly once it is saved. So, if i save the post and come back, I cannot change the User related to the note, IDEAL! What I cannot figure out is how I can make that same User field dropdown disabled when it is created by clicking “Add Row”.
I do not want the user to be able to pick any option other than their own name. I know I could use load_field or load_value to limit the options to just their user but it would be much easier to disable the field.
It would have been more simple to help if you posted the code you used to get the User field to populate and to disabled/readonly the sub-field once it is saved.
To put you on the path (to be confirmed depending on your code) :
2) Use the “prepare_field”/”load_value” functions to populate your sub-field value (as you probably done) and to set the field to “readonly” (required to avoid weird reaction of ACF when trying to save a JS disabled input)
3) Save the sub-field value by using “update_value” / “save_post” or other function (because the disabled and “readonly” sub-field will not be saved automatically).
It is not necessarily the ultimate solution, but it’s work for me. Hope it helps, send you code if you want more details =).