Vue.js: Prevent form submit only if condition true

Viewed 4862

I am using VeeValidate for validating a form. However, I want to submit the form without using JS. However, I still want users not to be able to submit, if there are any errors. If I use

<form @submit.prevent="validateBeforeSubmit">

it is disabling the default action completely.

Can you think of any solution to this? Thank you!

2 Answers

Try to add () for validateBeforeSubmit like this:

<form @submit="validateBeforeSubmit()">
Related