Closed powerbuoy closed 1 month ago
Well I shouldn't have said impossible, because after some more tinkering I indeed managed to stick [] in the name attribute. But could still be useful to know whether or not this is doable without changing the name?
Hi. This is not possible with this library. The array syntax is required to make it an array.
I have a form with multiple checkboxes, all named
test
(unfortunately, out of my control, not namedtest[]
).When trying to populate them using data like this
{"test": ["foo", "bar"]}
nothing happens.Also, when fetching the form data as JSON I also only get the first checkbox.
Is there any way I can get around this problem?
https://codepen.io/powerbuoy/pen/KKOMBee
(NOTE: Changing the name to
test[]
resolves the issue, but again, is impossible for me to do in this case).