Change field property

default discord avatar
xavierpacheco
5 months 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
    akacronos
    5 months 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

    Screenshot_2023-04-22_at_3.21.56_p.m..png
    Screenshot_2023-04-22_at_3.22.53_p.m..png
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.