Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

meteor-autoform

> 数据库
Open source

AutoForm is a Meteor package that adds UI components and helpers to easily create basic forms with automatic insert and update events, and automatic reactive va

1.4K stars0 likes3 views
WebsiteGitHub

About

AutoForm is a Meteor package that adds UI components and helpers to easily create basic forms with automatic insert and update events, and automatic reactive va

AutoForm

AutoForm is a Meteor package that adds UI components and helpers to easily create basic forms with automatic insert and update events, and automatic reactive validation. Versions 6+ of this package require that you separately install the simpl-schema NPM package. Prior versions require and automatically install the simple-schema Meteor package. You can optionally use it with the collection2 package, which you have to add to your app yourself.

NOTE: AutoForm 7.0

AutoForm 7.0 is now available and decouples from the default themes. You will have to install themes manually!

Be sure to check out the change log for full details, first. Note that if you use add-on packages that haven't been updated yet, you will not yet be able to update to version 6.

Add-on Package Authors: Please test your package against AutoForm 7.0, and then release a major version update in which you change your api.use to api.use('aldeed:[email protected]');. We do NOT recommend using something like api.use('aldeed:[email protected] || 7.0.0'); to try to support multiple major versions of AutoForm because there is currently a known Meteor issue where trying to support too many dependency paths leads to running out of memory when trying to resolve dependencies.

Table of Contents

Table of Contents generated with DocToc

  • Installation
    • Migration from 6.x
    • Import using static imports
    • Import using dynamic imports
    • Community Add-On Packages
      • Custom Input Types
      • Themes
      • Admin Panels
      • Content Management Systems
      • Components
      • Other
  • Demo
  • Example
    • A Basic Insert Form
    • A Basic Update Form
    • A Custom Insert Form
    • Another Custom Insert Form
  • Component and Helper Reference
    • autoForm
    • quickForm
    • afFieldInput
    • afFieldMessage
    • afFieldIsInvalid
    • afFormGroup
    • afQuickField
      • afQuickField Examples
    • afFieldValue
    • afFieldValueIs and afFieldValueContains
    • afFieldNames
    • afQuickFields
  • Objects and Arrays
    • afObjectField
    • afArrayField
    • afEachArrayItem
    • afArrayFieldIsFirstVisible and afArrayFieldIsLastVisible
  • Form Types
    • insert
    • update
    • update-pushArray
    • method
    • method-update
    • normal
    • disabled
    • readonly
  • Public API
  • Non-Collection Forms
    • An Example Contact Form
  • Fine Tuning Validation
  • Manual Validation
  • Resetting Validation
  • The Form Document
    • Getting Current Field Values
  • Callbacks/Hooks
    • formToDoc, formToModifier, and docToForm
  • Putting Field Attribute Defaults in the Schema
  • Complex Schemas
  • Dates
    • type=date
    • type=datetime
    • type=datetime-local
  • Theme Templates
    • Using a Different Template
    • Creating a Custom Template
  • Grouping Fields
  • Sticky Validation Errors
  • Defining Custom Input Types
  • Common Questions
    • Should the value of schema and collection have quotation marks around it?
    • Which components should I use?
    • Can I reuse the same quickForm or autoForm for both inserts and updates?
    • How can I show an asterisk after the label for required fields?
    • What are the various ways I can specify options for a select, radio group, or checkbox group?
      • Use allowed values array from the schema as both the label and the value
      • Set options in the schema
      • Calculate options in the schema
      • Use a helper
    • Can I put HTML in my error messages?
  • Examples
  • Troubleshooting
  • Contributing
  • Testing
  • Credits
  • License

Installation

In a Meteor app directory, enter:

$ meteor add aldeed:autoform

Also install SimpleSchema NPM package separately (AutoForm 6+):

$ npm i --save simpl-schema

And then also extend SimpleSchema to allow the autoform option in your schemas, if you plan to use it:

import SimpleSchema from 'simpl-schema';
SimpleSchema.extendOptions(['autoform']);

By default there is no theme included, so you will have to install a theme, too. The following themes are available and tested to work with v7:

  • autoform-plain
  • autoform-bootstrap3
  • autoform-bootstrap4
  • autoform-bootstrap5

Please also consider, that twbs:bootstrap is depending on an outdated (and potential insecure!) Bootstrap version. Better: Use the latest Bootstrap 3.x or 4.x from NPM in favour.

Migration from 6.x

If you update to 7.0.0 you will likely encounter errors from your extension packages like

bash
While selecting package versions:
error: Conflict: Constraint aldeed:[email protected] is not satisfied by aldeed:autoform 7.0.0.
Constraints on package "aldeed:autoform":
* aldeed:autoform@=7.0.0 <- top level
* aldeed:[email protected] <- someone:packagename x.y.z

You can easily circumvent this issue by editing the package entry in .meteor/packages from aldeed:autoform to aldeed:[email protected]! (note the exclamation mark).

This is because many extensions will not have the 7.0.0 reference in their package.js file, yet. However, this major version is intended to not break compatibility with extensions, that worked with 6.x. If you encounter any runtime issues with extensions, please open an issue.

Import using static imports

If you come from a previous version and want to "keep things as they were" then this is the option you should choose.

AutoForm now comes only with the core functionality added to the initial package code. In order to make the Templates available, too, you only need to put the following line into your top-level client startup code (for example imports/startup/client/autoform.js):

javascript
import 'meteor/aldeed:autoform/static'

That's it. The Templates are now available.

Import using dynamic imports

This package supports dynamic-import, which helps to reduce initial bundle size of the package from ~110 KB to ~60 KB (estimated via bundle-visualizer).

The following example shows how to import the packages dynamically:

javascript
import 'meteor/aldeed:autoform/dynamic'

AutoForm.load()
  .then(() => {
    // ... on init success code, for example set a ReactiveVar to true
  ))
  .catch(e => {
    // ... on error code
  })

You can even combine this with one of the themes (if they support dynamic imports) like in the following example:

…

Note, that you can't use the #autoForm or >quickForm Templates before the import has not completed. You can however use a ReactiveVar in your Temlate to "wait" with rendering the form:

javascript
import { ReactiveVar } from 'meteor/reactive-var'
import { initAutoForm } from 'meteor/aldeed:autoform/dynamic'

const autoFormLoaded = new ReactiveVar()

initAutoForm()
  .then(() => autoFormLoaded.set(true))
  .catch(e => {
    // ... on error code
  })

// ... other Template code

Template.myCoolForm.helpers({
  loadComplete() {
    return autoFormLoaded.get()
  }
})

Community Add-On Packages

Submit a pull request to add your package to this list!

Custom Input Types

Dates and times:

  • aldeed:autoform-bs-datepicker
  • aldeed:autoform-bs-datetimepicker
  • miguelalarcos:afwrap-xdatetime
  • notorii:autoform-datetimepicker
  • lukemadera:autoform-pikaday
  • antalakas:autoform-bs-daterangepicker
  • drewy:autoform-datetimepicker
  • bookmd:autoform-time-from-now
  • jkutianski:autoform-datemask

Selects:

  • aldeed:autoform-select2
  • aldeed:autoform-bs-button-group-input
  • comerc:autoform-selectize
  • vazco:universe-autoform-select
  • lukemadera:autoform-autocomplete
  • rikonor:autoform-image-gallery
  • newnectar:meteor-autoform-select-country-flags

WYSIWYGs:

  • mpowaga:autoform-summernote
  • donchess:autoform-froala
  • vimes1984:autoform-textangular

Markdowns:

  • q42:autoform-markdown

Autocompletes:

  • comerc:autoform-placecomplete
  • miguelalarcos:afwrap-xautocomplete
  • comerc:autoform-typeahead
  • lukemadera:autoform-googleplace
  • [lukemadera:autof

Issues· 24 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptautoformautoform-bsblazeform-schemas

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库