You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the Checkbox in a form together with server actions in NextJs. The form lives on a server component, the Checkbox is in a client child component.
What I would like to do is submit the form as soon as one of the values change, using the input type="checkbox"'s synthetic event to access the containing form, like so.
I'm using the Checkbox in a form together with server actions in NextJs. The form lives on a server component, the Checkbox is in a client child component.
What I would like to do is submit the form as soon as one of the values change, using the input type="checkbox"'s synthetic event to access the containing form, like so.
<Checkbox name="tos" onChange={(e) => e.currentTarget.form?.requestSubmit()} />
However, the only event the Checkbox seems to have is a
onCheckedChange
with a boolean, which is quite limitedthe
onClick
on the Checkbox is not useful either, because at this point the underlying checkbox is not yet changed..The text was updated successfully, but these errors were encountered: