Make field readOnly in Admin based on another field vlaue

default discord avatar
fedoraman
last month
4

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

  • default discord avatar
    thisisnotchris
    last month

    Hello @fedoraman, my first guess is

    https://payloadcms.com/docs/fields/overview


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

  • discord user avatar
    Jarrod
    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!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

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