Is it possible to let users specify the form fields and then allow them to store it in a collection using SimpleSchema in a dynamic way. I want to create an app where one can specify the data they wan t to collect.
Hi @digitalx778,
This itself is quite simple. Just have a collection with a field āformsā or something. Then set it to be an array of objects. Then put in the blackbox capability on this field. So you should have something into which you can save an object with several properties.
If you are using blaze, this is awesome because now you can hook up @aldeedās Autoform and then can generate forms off the back of whatever stored data the user has given you.
I donāt use blaze, and (tbh i donāt know) I donāt think anything similar exists for React. But you could always build a few custom components to make the forms off the back of user stored information.
Tat
I am using blaze. Thanks for the reply. I think I was heading down the right path. Could you elaborate a bit more (noob here). What do you mean by blackbox capability?
What do you mean by this? I read up on blackbox still unsure of it. Do you have to create an object say:
var fields= {
āfirstNameā: {
type: String
},
ālastNameā: {
type: String
}
And now I want to place it in as a SimpleSchemaBut how are you suppose to reference the object in SimpleSchema. Since it is not of type SimpleSchema but how can I place this object in the schema and let autoform render itā¦
I did a demo some time ago with aldeed:autoform with this very technique:
Sidenote: for React you can use the excellent uniforms package: https://github.com/vazco/uniforms which comes with bootstrap3+4 and semantic-ui templates, but itās also really good to roll your own form-ui.
Nice, this is exactly what I want to implement!. Meteor is cool but the community is also helpfulā¦ I will be using blaze not focused on react right now.