mardi 23 novembre 2021

Update automaticaly switch button on checked

I have issues in my project. In deed, I want to update automatically a switch button when I check it. The case that I have is that when I click on the switch button, the page is refresh but the value is not changed.

my code :

<div class="col-4 text-left">
     <form  id="form" class="was-validated" method="POST" action="" enctype="multipart/form-data">
     @method('PUT')
     @csrf
         <div style="float: right">
              <label class="switch">
                  <input type="checkbox" onchange="$('#form').submit();" name="cas_suivi" id="cas_suivi" type="checkbox"  >
                      <div class="slider"></div>
              </label>
          </div>
       </form>
     </div>



Aucun commentaire:

Enregistrer un commentaire