gmac / backbone.epoxy

Declarative data binding and computed models for Backbone
http://epoxyjs.org
MIT License
615 stars 89 forks source link

Bind on submit #41

Closed sshmyg closed 9 years ago

sshmyg commented 11 years ago

Hello, how can I bind data on submit event? For example I have some bindings for inputs, and when I submit form I would like to trigger this bindings for inputs and in this way update model before sending?

Is some way to do it?

gmac commented 9 years ago

I'm going to close this out. Submit events don't really fall within Epoxy's purview, which is field-specific data binding. A form isn't necessarily going to have bound data attributes that need to change on submit, and if it does, you can always add an events:['submit'] declaration to make bindings trigger in response to a submit event.

More likely, you're going to want to bind a handler function onto a form submit, for which you'd just go through Backbone's standard events hash to delegate a handler method within the view.