-
I use this code and I want the second checkbox to be unchecked and disabled when the first checkbox is disabled,Currently only disabled not unchecked. |
Beta Was this translation helpful? Give feedback.
Answered by
SimoTod
Dec 1, 2021
Replies: 1 comment 1 reply
-
You can use x-effect: <div x-data="{accept: false}">
<input type="checkbox" x-model="accept" name="accept" id="accept" >
<input type="checkbox" x-bind:disabled="!accept" name="accept2" id="accept2" x-effect="if(!accept) $el.checked = false">
</div> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Shadecute
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use x-effect: