jkuester:autoform-hint

v0.1.0Published 6 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

meteor-autoform-hint

Add hints to your quickForms using SimpleSchema.

Installation

meteor add jkuester:autoform-hint

This will auto-override the rendering method of afFormGroup_bootstrap3 template. The template will keep all it's original functionality. Works also with bootstrap4.

Usage

Define a hint on your schema:

1new SimpleSchema({
2  username: {
3    type: String,
4    autoform: {
5      hint: 'Enter a username. Allowed characters are....'
6    }
7  },
8  password: {
9    type: String,
10    autoform: {
11      hint: 'Enter a password. Allowed characters are....'
12    }
13  }
14})

Customization

Note, that the default position is on top next to the label. You can also define the position more precise using hintTop and hintBottom:

1new SimpleSchema({
2  username: {
3    type: String,
4    autoform: {
5      hintTop: 'Enter a username. Allowed characters are....'
6    }
7  },
8  password: {
9    type: String,
10    autoform: {
11      hintBottom: 'Enter a password. Allowed characters are....'
12    }
13  }
14})

You can also customize the position / style by defining the following css classes:

1.afhint-bottom-block {
2  /* style here */
3}
4
5.afhint-top-block {
6  /* style here */
7}

License

MIT, 2018 Jan Küster