Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

wowzaaa's avatar

Disable field

Hi,

How can i disable for example a checkbox or a select if one of them is pressed. Because if I let both active a user can select both of them and i don't wanna let him choose both, just one in case if is selected and the other one to be disabled or atleast if he submits both to throw a exception or something...

0 likes
4 replies
topvillas's avatar

Are you using a framework or vanilla Javascript?

tinfoilman's avatar

Just curious, why wouldn't you just use a radio button instead of a checkbox? That's what they're meant for.

wowzaaa's avatar

I'm using laravel nova and I have a boolean and a select field. I just wanna don't let the user to submit both of the options at once. If I can not disable one of them if the other is clicked atleast to throw an exception to let him know he can't do that.

wowzaaa's avatar

from my understanding nova does not have radio buttons

Please or to participate in this conversation.