Replies: 3 comments 2 replies
-
Please provide a codesandbox url to re-produce the issue. Since it's really hard to find a workaround without knowing |
Beta Was this translation helpful? Give feedback.
-
The checkbox form piece looks like this:
The submit handling works like this
I've tried different variations of header types (e.g. multipart/form-data) and body submission but it doesn't matter. Is there a way to prevent the checkbox string name with brackets from being interpreted as an array by react-hook-form? |
Beta Was this translation helpful? Give feedback.
-
Since those fields are just single field data, you can register field name with other unique character as delimiter, like
For example: https://codesandbox.io/s/friendly-albattani-h5k3tp?file=/src/App.tsx |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to submit a MailChimp form that uses brackets for its checkbox names. For example: group[34498][2]
According to this page: https://react-hook-form.com/api/useform/register/#rules it seems like it takes the string name and interprets it as an array if there are . or []. I'm sure that's useful in some situations but in this case, it's preventing me from submitting the form I need. Is there anyway around this issue?
Beta Was this translation helpful? Give feedback.
All reactions