Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Change field property

default discord avatar
xavierpacheco2 years ago
1

Hello, I am trying to change a Select box hidden to false when the user checks a radio button with an afterChange hook, however I am not succeeding and I don't know what is wrong.... Can some one help? Thnak you very much!

  • default discord avatar
    akacronos2 years ago

    I think it would be better to do it with the admin condition in the field.



    I show-hide fields base in other sibling fields with this:


    https://payloadcms.com/docs/fields/overview#conditional-logic

    Here, I show/hide the field endDate based on other radio button.



    This is the radio, if calls option is selected, the endDate field appears

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.