Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
backbone.syphon
<script id="my-form-template" type="text/html">
<form>
<input type="text" id="foo" value="bar">
<input type="checkbox" id="chk" checked>
</form>
</script>
Backbone.View.extend({
events: {
"submit form": "formSubmitted"
},
formSubmitted: function(e){
e.preventDefault();
var data = Backbone.Syphon.serialize(this);
this.model.set(data);
this.model.save();
},
render: function(){
// build the view's form, here
}
});
{
foo: "bar",
chk: true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.