Meteor - autoform - autoForm

meteor-autoform

What is the purpose of the 'validation' attribute of the autoform package?

Optional. This is used to fine tune validation.

What is the purpose of the 'template' attribute of the autoform package?

Optional. Specify appropriate theme template.

What is the purpose of the 'meteormethod' attribute of the autoform package?

Optional. When type is "method" or "method-update", indicate the name of the Meteor method in this attribute.

Will call the server method with the name you specify in the meteormethod attribute. Passes a single argument, doc, which is the document resulting from the form submission. You may optionally specify a DDP Connection in the ddp attribute. If you do, the method will be called using the DDP connection provided.

The method is not called until doc is valid on the client. You must call check() in the method or perform your own validation since a user could bypass the client side validation.

What is the purpose of method-update?

Will call the server method with the name you specify in the meteormethod attribute. There are two possible ways your method can be called.

  1. By default, your method will be called with two arguments:
    • modifier: the modifier object generated from the form values
    • documentId: the _id of the document being updated
  2. If you set singleMethodArgument=true as a form attribute, your method will be called with a single object argument with _id and modifier properties. You should do this if using the mdg:validated-method package.

You may optionally specify a DDP Connection in the ddp attribute. If you do, the method will be called using the DDP connection provided. The method is not called until modifier is valid on the client. You must call check() in the method or perform your own validation since a user could bypass the client side validation. Using the mdg:validated-method package is recommended.

What is the purpose of the 'ddp' attribute of the autoform package?

Optional. When type is "method" or "method-update", provide an alternative DDP Connection that should be used to call the Meteor method in this attribute.

What is the purpose of the 'resetOnSuccess' attribute of the autoform package?

Optional. The form is automatically reset for you after a successful submission action. You can skip this by setting this attribute to false.

What is the purpose of the 'autosave' attribute of the autoform package?

Optional. Set to true to enable automatic form submission for a type="update" form. Whenever the form change event is emitted, the change will be automatically saved to the database.

What is the purpose of the 'autosaveOnKeyup' attribute of the autoform package?

Optional. Set to true to enable automatic form submission for a type="update form on keyup event. Whenever a keyup event is emitted on a form field, the change will be automatically saved to the database (throttled to 500ms). It's best to set trimStrings=false when using this option. If you don't, spaces may be deleted while typing.

What is the purpose of the 'filter' attribute of the autoform package?

Optional. Set to false for an insert or update form to skip filtering out unknown properties when cleaning the form document.

What is the purpose of the 'autoConvert' attribute of the autoform package?

Optional. Set to false for an insert or update form to skip autoconverting property values when cleaning the form document.

What is the purpose of the 'removeEmptyStrings' attribute of the autoform package?

Optional. Set to false for an insert or update form to keep empty string values when cleaning the form document.

What is the purpose of the 'trimStrings' attribute of the autoform package?

Optional. Set to false for an insert or update form to keep leading and trailing spaces for string values when cleaning the form document.

What is the purpose of the 'setArrayItems' attribute of the autoform package?

Optional. Set to true for an update form that is updating specific array items. Note that there is a quirk of MongoDB that will create objects instead of arrays when this is set to true, if there is not already an array in the database. So if you set this to true, be sure that the corresponding array property is never null or missing in the database. It must always be an array with 0 or more items.

What is the purpose of the 'preserveForm' attribute of the autoform package?

Optional. Set to false to disable preserving of form values across hot refreshes. This can sometimes help resolve issues with sticky form values.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License