user1896653
user1896653

Reputation: 3327

How to disable vuetify form submit button until all the validation rules are full-filled

I have found the same question in this platform. Based on the accepted answer, I have built a form and made my button disabled.

<v-btn :disabled="!isFormValid">submit</v-btn>

data: () => ({
  isFormValid: false,
})

But, Whenever, I filled an input, the submit button would activated though all other inputs are empty!

enter image description here

So, what is the actual way to keep the button disabled until all the inputs are not empty?

Codepen Demo

Upvotes: 1

Views: 2981

Answers (1)

user459872
user459872

Reputation: 24922

You should remove the lazy-validation property. As per the documentation,

If lazy-validation is enabled, value(A boolean value representing the validity of the form.) will always be true unless there are visible validation errors

Upvotes: 3

Related Questions