Make field readOnly in Admin based on another field vlaue

default discord avatar
last month

How to make a field readOnly based on another field value?

  • default discord avatar
    last month

    Hello @fedoraman, my first guess is

    Where there is validation information, and that provides siblingData as a prop

  • discord user avatar
    Payload Team
    last month

    Currently readOnly is a boolean, so it cannot be conditional. This will likely be added as a feature in the near future.

    You could use access control on the field, and have the field.access.update return false based on other fields in the doc

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.