b-form submit.prevent doesn't work
See original GitHub issueI have this
<b-form v-on:submit.prevent="onSubmit" class="col-sm-12 col-md-6">
....
<b-button type="submit" variant="primary">Register</b-button>
</b-form>
and the onSubmit
method is not being called and it works with regular form
tag
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (12 by maintainers)
Top Results From Across the Web
Vue Prevent form submit when pressing enter inside form
You can prevent submission on enter key down just annotating the top-level form. <form @submit.prevent="handleLogin" @keydown.enter="$event.
Read more >Prevent Form Submission in Vue.js - SoftAuthor
In this article, I'm going to cover two different ways to prevent default form submission behaviour using vue.js.
Read more >Vue modal form @submit.prevent not working - Laracasts
I'm working on an internal Nova tool and I need to protect a delete button with a modal. My problem is I can't...
Read more >Form Validation - Vue.js
Fairly short and simple. We define an array to hold errors and set null values for the three form fields. The checkForm logic...
Read more >Form | Components - BootstrapVue
Form component and form helper components that optionally supports inline form styles and ... <template> <div> <b-form @submit.stop.prevent> <label ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If like me, it’s the third time you face weird behavior with your forms (for instance, using
v-on:submit.native.prevent="onSubmit"
still does not prevent redirection if you press enter), the only correct way to make forms is:As far as I’ve tried, any other technique causes unwanted redirections (either by pressing the button or pressing Enter)
I may open a PR on vue to better document this very necessary feature.