var User = Backbone.Model.extend({
schema: { title: { type: 'Select', options: ['', 'Mr', 'Mrs', 'Ms'] }, name: { type: 'Text', validators: ['required', 'message:hey_bud'] }, email: { validators: ['required', 'email'] }, birthday: 'Date', password: 'Password', address: { type: 'Object', subSchema: { street: {}, zip: { type: 'Number' }, country: { type: 'Select', options: ['Japan', 'Mongolia'] } } }, Radios: { type: 'Radio', options: { value1: '<b>trial</b>', value2: 'standard' }, validators: ['required'] }
}
});
var user = new User({
title: 'Mr',
name: 'Sterling Archer',
email: 'ster...@isis.com',
birthday: new Date(1978, 6, 12),
password: 'dangerzone',
});
var form = new Backbone.Form({
model: user,
submitButton: "Submit Btn Text"
}).render();
<script id="formTemplate" type="text/html">
<form>
<h1>New User</h1>
<h2>Main Info</h2>
<div data-fields="title,name,birthday,address"></div>
<h2>Account Info</h2>
<h3>Email</h3>
<div data-fields="email"></div>
<h3>Password</h3>
<p>Must be at least 8 characters long</p>
<div data-editors="password"></div>
<h3>Actions</h3>
</form>
</script>
If you're using that custom form template then that could be the reason - you'd need to include this part (from the original form template):
https://github.com/powmedia/backbone-forms/blob/master/src/templates/bootstrap3.js#L8-L10
--
You received this message because you are subscribed to the Google Groups "Backbone-forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to backbone-form...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<% if (submitButton) { %>\
<button type="submit" class="btn"><%= submitButton %></button>\
<% } %>\