ember-validated-form icon indicating copy to clipboard operation
ember-validated-form copied to clipboard

Submitting the form refreshes the page

Open omairvaiyani opened this issue 6 years ago • 6 comments

For some reason, despite setting an action on the forms on-submit, clicking on {{f.submit}} refreshes my browser, as if its posting the form. As a workaround I've set tagName="div" on my {{#validated-form}} block, and set the action directly on my submit button. But this has its own set of problems; specifically, the validations do not work when I click the submit button, as it no longer goes through this component's submit pathway. Any help?

omairvaiyani avatar May 02 '18 12:05 omairvaiyani

Nevermind, seems to be working now, very bizarre!

omairvaiyani avatar May 02 '18 12:05 omairvaiyani

Did you figure out what caused this? I'm seeing the same thing.

thomassnielsen avatar May 14 '18 12:05 thomassnielsen

I once encountered this with a nested <form> which would be invalid HTML. Is this the case for you?

anehx avatar May 14 '18 12:05 anehx

No, the form is not nested. It's a pretty basic setup. It's in a component, that's the only possibly unusual part of my setup I can think of. Also, the model is just an empty Ember.Object.

thomassnielsen avatar May 14 '18 12:05 thomassnielsen

Can you provide a twiddle (based on https://ember-twiddle.com/3691a8576c35ff149bfc26a564ec5437) reproducing your use case?

anehx avatar May 14 '18 12:05 anehx

I tried to create a twiddle, but it got stuck building when I changed to the latest version of Ember. Anyway, it seems like it's related to an error in my submit action. When I have an empty submit action, the page does not reload.

thomassnielsen avatar May 14 '18 13:05 thomassnielsen

Closing this as it seems to be an integration issue.

anehx avatar Sep 20 '22 07:09 anehx