diff --git a/apps/docs/src/examples/checkbox-group.tsx b/apps/docs/src/examples/checkbox-group.tsx index c782f9fe..687427a0 100644 --- a/apps/docs/src/examples/checkbox-group.tsx +++ b/apps/docs/src/examples/checkbox-group.tsx @@ -178,7 +178,14 @@ export function HTMLFormExample() { e.stopPropagation(); const formData = new FormData(formRef); - alert(JSON.stringify(Object.fromEntries(formData), null, 2)); + const subscriptions = Array.from(formData.getAll('subscriptions')); + + const result = { + ...Object.fromEntries(formData), + subscriptions, + }; + + alert(JSON.stringify(result, null, 2)); }; return ( diff --git a/apps/docs/src/routes/docs/core/components/checkbox-group.mdx b/apps/docs/src/routes/docs/core/components/checkbox-group.mdx index 4b5fb44d..440be9c4 100644 --- a/apps/docs/src/routes/docs/core/components/checkbox-group.mdx +++ b/apps/docs/src/routes/docs/core/components/checkbox-group.mdx @@ -352,8 +352,16 @@ function HTMLFormExample() { const onSubmit = (e: SubmitEvent) => { e.preventDefault(); e.stopPropagation(); + const formData = new FormData(formRef); - alert(JSON.stringify(Object.fromEntries(formData), null, 2)); + const subscriptions = Array.from(formData.getAll('subscriptions')); + + const result = { + ...Object.fromEntries(formData), + subscriptions, + }; + + alert(JSON.stringify(result, null, 2)); }; return (