I am facing an issue with my button that is supposed to be disabled until all validation requirements are met. Currently, the button only gets disabled after I click it for the first time and encounter validation errors. I need the button to be disabled right from the start until all inputs are correctly entered. Can anyone provide assistance with this matter?
Form component
<template>
<div class="form-wrapper">
<form @submit.prevent="handleSubmit(sendFormData)" novalidate>
<slot name="form-content"/>
<slot name="button-submit" :is-invalid="isInvalid"/>
</form>
</div>
</template>
inputs component (only showing the button section for this part):
<template #button-submit="{isInvalid}">
<button :disabled="isInvalid && !selectedTown"
:class="{'button-main-disabled': isInvalid && !selectedTown}"
type="submit"
class="button-main button-add">
Add School
</button>
</template>