bind: function (type, doNotStore) {
var parsleyInstance;
switch (type) {
case 'parsleyForm':
parsleyInstance = $.extend(
new Form(this.element, this.domOptions, this.options),
new Base(),
window.ParsleyExtend
)._bindFields();
break;
case 'parsleyField':
parsleyInstance = $.extend(
new Field(this.element, this.domOptions, this.options, this.parent),
new Base(),
window.ParsleyExtend
);
break;
case 'parsleyFieldMultiple':
parsleyInstance = $.extend(
new Field(this.element, this.domOptions, this.options, this.parent),
new Multiple(),
new Base(),
window.ParsleyExtend
)._init();
break;
default:
throw new Error(type + 'is not a supported Parsley type');
}
if (this.options.multiple)
Utils.setAttr(this.element, this.options.namespace, 'multiple', this.options.multiple);
if ('undefined' !== typeof doNotStore) {
this.$element.data('FieldMultiple', parsleyInstance);
return parsleyInstance;
}