backbone-forms giving error as Uncaught TypeError: t is not a constructor

277 Views Asked by At

I am working with JSON Schema and backbone forms for the first time. I have copied the same example as mentioned in backbone forms but it is giving error as shown below:

enter image description here

The code is mentioned below :

var registerForm = Backbone.Model.extend({
    schema:{
         title:      { type: 'Select', options: ['Mr', 'Mrs', 'Ms'] },
    name:       'Text',
    email:      { validators: ['required', 'email'] },
    birthday:   'Date',
    password:   'Password',
    notes:      { type: 'List', itemType: 'Text' }
    }
});
 var user = new registerForm();
 var form = new Backbone.Form({
     model: user
 }).render();         $('body').append(form.el);

Please help me to resolve this issue.

1

There are 1 best solutions below

0
Tomasz Jakub Rup On

You cannot include List editor. This is a special editor which is in a separate file and must be included:

<script type="text/javascript" src="backbone-forms/distribution/editors/list.js" />

https://github.com/powmedia/backbone-forms#list