-
Notifications
You must be signed in to change notification settings - Fork 163
Open
Labels
Description
How would i go about creating a form that outputs:
<input name="name" type="text">
<input name="properties[0][var1]" type="text">
<input name="properties[0][var2]" type="checkbox">
<input name="properties[1][var1]" type="text">
<input name="properties[1][var2]" type="checkbox">
or alternatively if thats not possible:
<input name="name" type="text">
<input name="properties[var1]" type="text">
<input name="properties[var2]" type="checkbox">
<input name="properties[var1]" type="text">
<input name="properties[var2]" type="checkbox">
I need to add the array fields to the form dynamically based on the number of fields in the document i retrieve from mongo.
The data i need to bind to the form is in the following format:
{
name: 'xxxxx'
properties: [
{var1: 'yyy', var2: true },
{var1: 'zzz', var2: false}
]
}
I thought about creating a form using fields.array() for the properties attribute and using a custom widget that renders fields.object instead of fields.string but cant seem to get it working.
Is there a simple solution?
Danita