Serialize form input values as array #1615
Replies: 3 comments 4 replies
-
Is this a native web forms functionality? If yes, it should just work. Remix goes all-in into web standards, complementing them with features to provide a modern user experience. I believe, adding non-standard behavior to input elements will not a feature, remix will get. However, you can still submit a request with client-side js and put whatever values you want in there. |
Beta Was this translation helpful? Give feedback.
-
There are some examples on how to deal with this in #1541 |
Beta Was this translation helpful? Give feedback.
-
https://remix.run/docs/en/v1/pages/faq#how-can-i-have-structured-data-in-a-form <input value="Hey" type="text" name="items" />
<input value="Remix" type="text" name="items" />
<input value="Awesome" type="text" name="items" />
// ...
formData.getAll("items")
// ["Hey", "Remix", "Awesome"] |
Beta Was this translation helpful? Give feedback.
-
Basically, we can access single input values with name attributes on the server-side. That would be awesome if we can access dynamic nested array values over the server-side as well.
So for example:
Expected output on the server-side:
Beta Was this translation helpful? Give feedback.
All reactions