Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

backbone.syphon

View 1.html
1 2 3 4 5 6
<script id="my-form-template" type="text/html">
<form>
<input type="text" id="foo" value="bar">
<input type="checkbox" id="chk" checked>
</form>
</script>
View 1.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
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
}
});
View 1.html
1 2 3 4
{
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.