Support

Account

Home Forums Add-ons Repeater Field problem with disabled fields

Solving

problem with disabled fields

  • Dear Friends
    I am using ACF pro Version 5.7.10 and have a repeater group field named “messages”, this group have 3 text field, i want to disable editing this text fields after updating post and used this code:

    /***

    function disable_message_load_field( $field ) {
    
    $field['disabled'] = 1;
    return $field;
    }
    add_filter('acf/load_field/name=message_box_message_content', 'disable_message_load_field');

    ****/

    the problem is after creating some rows and updating (for example 14 rows) it start to remove all previous saved rows and only keep last one.
    when i commented above filter, repeater fields work good (but not disabled),

    How i can fix this ? i need to keep rows data and make theme disabled !!
    (I Disabled all plugins and i can say the problem just appear whit “disable_message_load_field” function.

  • That is because you’ve disable them. Disabled fields are not submitted. Try using readonly.

  • Dear John
    if i make fields readonly, i cant put data in theme.i need my user send information via this fields but couldn’t edit theme after submission.

  • If a field is disabled then it is not submitted. An un-submitted field cannot be processed. Making a field disabled is the same as deleting it.

    Read only fields, the content can be viewed but not changed. The data in the field is still submitted so that it can be saved.

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

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.