Search code examples
meteormeteor-autoform

Displaying a field with Auto Form without it being saved to the DataBase?


I have a form using Meteor SimpleSchema and Auto Form.
I have a few fields there, but I'm trying to have a field that would show up on the form (with SimpleSchema validation), but won't be saved into the Database.

How do I do that?


Solution

  • On your form you can specify type="method" and meteormethod="nameofmeteormethod" and handle the saving to the database yourself in the corresponding meteor method. So you can insert all the fields except the one that you do not want to save. Just make sure to use check in your meteor method to check the data you receive from the client against your AutoForm schema.