Aero
Aero

Reputation: 317

Access nested template data meteor/blaze

I'm currently creating a dynamic form generator app using meteor, blaze, spacebars.

I have the form template with a block helper that loops through an array of inputs in my schema which then generates the input templates within the form.

Due to requirements the current value each input is stored as a reactive var within each input template.

When the form is submitted I would like to grab all the data values from each child input template but am unable to figure out how I should go about it. There's plenty online about accessing parent data but not child data.

Am I missing something simple here?

Thanks

Upvotes: 1

Views: 228

Answers (1)

Aero
Aero

Reputation: 317

So in the end I added an ID to each input and assigned it to the html name attribute.

I then grabbed all data from the form and link the inputs back to the original schema.

Upvotes: 2

Related Questions