AutoForm Masked Input is a plugin for the AutoForm that allows for use of Igor Escobar's jQuery Masked Plugin within your form.
To add an automask, simply set the autoform type to masked-input
and provide the desired mask and options, like this:
Schemas.Example = new SimpleSchema({
phone: {
type: String,
autoform: {
type: 'masked-input',
mask: '(000) 000-0000',
maskOptions: {
placeholder: '(___) ___-____'
}
}
}
});
The mask
will default to "00/00/0000"
if one is not provided. Any values you place in the maskOptions
will be passed to the Mask Plugin
directly. See the documentation here for more details on what options can be passed in.