ember-validated-form
ember-validated-form copied to clipboard
Submitting the form refreshes the page
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?
Nevermind, seems to be working now, very bizarre!
Did you figure out what caused this? I'm seeing the same thing.
I once encountered this with a nested <form>
which would be invalid HTML. Is this the case for you?
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.
Can you provide a twiddle (based on https://ember-twiddle.com/3691a8576c35ff149bfc26a564ec5437) reproducing your use case?
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.
Closing this as it seems to be an integration issue.