0
votes

I am building a testing app where admin can build up questions for each test, each test will have its own set of fields (text, drop down, checkboxes, radio...etc), so I was wondering if there is any Meteor package that can help me with the dynamic form generation?

I've checked aldeed: autoform but as far as I understood all form fields (schema) must be defined statically, while in my case it is dynamically generated, saved/ retrieved in/ from the tests collection, where I save each test along with its fields (label, type, min, max...etc). Thanks

1

1 Answers

1
votes

Autoform could automatically create your form based on a schema as it uses simple schema (or alternatively collection2). You could store and update your schema in the DB serialized for example and then use it with parseJSON.

var schema = $.parseJSON(jsonFromDB);
CollectionSchema = new SimpleSchema(schema);

{{> quickForm schema=CollectionSchema}}

Not tested but I think it should work.