Can I save form values into different collections in aldeed:autoform?


#1

I want to have autoform form, that saves data into 2 different collections. How can I do that?


#2

You could use a type method with your autoform.

Then split up the values in the method function to go to different collections?

EDIT:

I forgot the issue is with rendering the form…

You could render the form based on a schema that isn’t tied to a collection, then do the method call and submit the values to the correct collections. So the “new” schema would include whatever fields you need for each collection.

Autoform docs has a section on this.

Or it may be worth just creating a form from scratch (without autoform). Forms from scratch actually don’t take much longer than using autoform.


#3

thanks, I have just started playing with meteor for few days, do you think you can provide a simple code sample?


#4

I can’t right this minute, I bet somebody else will.

also: https://github.com/aldeed/meteor-autoform#non-collection-forms


#5

thanks buddy, I’ll go through the documentation