0

I have a simple form that I'm using as a template in a Marionette ItemView, but for some reason, when I click submit, the form action doesn't work! I know the form is submitting since form submit event works and I can get around this issue by adding in such event handlers (commented out below). However, I'd much rather just use the form action feature as that's much easier. Anyone have this issue with Marionette / Backbone?

template file:

<form action="/valid_route" method="POST">
<div class="form-group">
    <input class="form-control" type="text" name="text"/>
    <button type="submit">Submit</button>
</div>
</form>

Marionette ItemView:

var View = Marionette.ItemView.extend({
    template: template,
    //
    // ui: {
    //     form: 'form'
    // },
    //
    // triggers: {
    //     'submit @ui.form': 'submit'
    // },
    //
    // onSubmit: function () {
    //     console.log("Submit!!!")
    // },

});
tetutato
  • 620
  • 5
  • 16
  • Your form _does_ submit in a plain HTML page (because [` – joews Jul 20 '16 at 22:16
  • Is the `
    ` nested in a `
    ` from another view? [http://stackoverflow.com/questions/379610/can-you-nest-html-forms](forms shouldn't be nested).
    – joews Jul 20 '16 at 22:20
  • That's not the case, I've tried testing with nothing in the Dom body but this form. :/ – tetutato Jul 20 '16 at 23:13
  • What browsers? It submits in the latest Chrome and Safari. – joews Jul 20 '16 at 23:22
  • I've tried in chrome. It's weird because in chrome developer mode I can see the form without any issues in the dom. I'll post a picture later tonight. – tetutato Jul 21 '16 at 14:51

0 Answers0