1
I have a input
in the Vuejs that is inside a form
and when I press enter
I don’t want the form
is submitted.
Together with Vuejs I am using Quasar and I was able to assign the function call only in the key enter
:
<form @keydown.enter="evitarSubmit">
Function:
evitarSubmit () {
console.log('Tentou evitar')
}
I’m having a hard time finding and drafting a code that nullifies the effect of enter
about the form
, but I accept suggestions...
if you’re getting right into the
evitarSubmit()
, just put aevent.preventDefault()
, that it cancels the Ubmit form.– Vinicius
https://stackoverflow.com/questions/895171/prevent-users-from-submitting-a-form-by-hitting-enter
– user60252