lundi 6 juin 2022

how can I only allow a user to select only one checkbox (bootstrap checkbox)?

I added bootstrap checkboxes in my code, but the user should be able to select only one checkbox, the others get unchecked automatically. But I m not able to do that, can someone tell what should I add in my code please Here is the screenshot of the result

<div class="form-check form-switch" style="display: flex;">
                               
     <label class="form-check-label" for="uo1">UO1</label><br>
     <input class="form-check-input" type="checkbox" name="uo1" id="uo1" value="0" />
     
      <div id="uo1div" style="display:none">
       <BR> TJM = 225 €
      </div>
                                 
   <script type="text/javascript">
      $('#uo1').change(function() {
           $('#uo1div').toggle();
      });
   </script>

</div>



Aucun commentaire:

Enregistrer un commentaire