Is there a way to add input type that allows input arrays?
Is there a way to add input type that allows input arrays?
hubindustrial
Posts: 3Questions: 2Answers: 0
I need to be able to have multiple text inputs, but all with the same name, but as an array, like this:
<input type="text" name="data[]" id="data-1" />
<input type="text" name="data[]" id="data-2" />
<input type="text" name="data[]" id="data-3" />
Notice the name value is an array.
How can I accomplish this with the Editor?
Thanks.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
What is the use case for that? Is Editor used as standalone or with Datatables?
I see only two ways:
preSubmit
Hi,
There isn't a built in way of of allowing text input like that, but you could readily write a little field type plug-in that allows that (it would just add the fields required and return an array as the value).
You can use
checkbox
with an array of values at the moment, and 1.5.1 will introduce the ability to useselect
with an array of values - but these are both predetermined values.A final option might be to use Select2 or similar which does allow reform input and will work fine with arrays.
Allan