Sorry about the title - I didn't know how else to explain it. However, I am initializing an object like this:
var form = {};
form.title = 'Titel';
form.fields = { type: 'radio', label: 'First name', id: 1 }
Then I'm adding to the object:
form.fields.choices = { text : "Standard", value : "Standard" , isSelected : false, price : ''};
That gives me the following array:
Array (
[title] => Titel
[fields] => Array
(
[type] => radio
[label] => First name
[id] => 1
[choices] => Array
(
[text] => Standard
[value] => Standard
[isSelected] => false
[price] =>
)
)
)
However, I would like to add multiple arrays to the choices key like this:
Array (
[title] => Titel
[fields] => Array
(
[type] => radio
[label] => First name
[id] => 1
[choices] => Array(
Array (
[text] => Standard1
[value] => Standard1
[isSelected] => false
[price] => ),
Array (
[text] => Standard2
[value] => Standard2
[isSelected] => false
[price] => )
)
)
)
How would I achieve that?