Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

256
Vistas
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>
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

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" />
about 4 years ago · Juan Pablo Isaza Denunciar

0

You can use radio button instead. and add css which look like checkbox. or you can use javascript or jQuery to uncheck all checkbox and then check current one.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda