Answer the question
In order to leave comments, you need to log in
How to submit a form when a checkbox is toggled?
I have a form with a checkbox and a button. When the button is clicked, the form is submitted, but how can I make the form submit when the checkbox is toggled?
Schematically it looks like this:
<form @submit.prevent="submitHandler">
<div class="switch">
<input type="checkbox" v-model="isRuLocale" />
<span class="lever"></span>
</div>
<button class="btn" type="submit">
Обновить
</button>
</form>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question