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>
>Solution :
You want a radio type input, not check boxes. Each input gets a unique id and value, but the same name to put it in a "radio group."
See https://www.w3schools.com/html/html_form_input_types.asp
<input class="form-check-input" type="radio" name="uo" id="uo0" value="0" />
<input class="form-check-input" type="radio" name="uo" id="uo1" value="1" />
<input class="form-check-input" type="radio" name="uo" id="uo2" value="2" />