I am having trouble rendering multiple select2 with JSON form.
$('#resource-form').jsonForm({
schema: {
rest: {
type: 'object',
properties: {
template_id: {
type: "array",
items: {
type: "string",
}
}
}
}
}
},
form: [
{
type: "select",
key: "rest.template_id[]"
}
]
});
$("select[name='rest.template_id[]']").select2({
data: data,
multiple: true
});
The Select2 functionality works very well, but when I submit the form, the backend receives an empty 'template_id' parameter.
{"rest"=>{"template_id"=>[]}}
I believe my schema and form setup may be incorrect. Can someone please assist me?