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

111
Vistas
Trying to associate a function to a specific radio generated on Django to show a modal

Im trying to make a modal show up on a onclick event function on django, but whenever i try to do it, instead of overwriting/adding the function on the radio, they just generate another radio on the side, how i can do that, at the same time, not generating another radio?

This is the html on django where the radios it is generated

<div class="form-row">
          <div class="col-lg-6 col-12 mb-1" style="line-height: 0px;">
            <h6 style="margin: 0px;">TONALIDADE</h6><br>
          </div>
          {% for choice, valor in situacoes_disponIns|slice:":3" %}
            <!-- descobrir como colocar parametro dentro da função -->
          <input type="radio"    class="col-lg-2 col-12 mb-1 d-flex justify-content-center align-items-center" value="{{ choice }}" name="sTonalidade" id="id_situacaoIns">
          {% if choice is 2 %}
          <input type="radio" onclick="funcao1();" class="col-lg-2 col-12 mb-1 d-flex justify-content-center align-items-center" value="{{ choice }}" name="sTonalidade" id="id_situacaoIns">
          
          {% endif %}

And this is the function where i call the modal to show up on clickevent

<script>
          function funcao1() //
          {                
               $("#cq-open").appendTo("body").modal("show");  
          }
          </script>

This is happening right now

And this is what i want to show, keeping the function I assigned(onclick that call the modal)

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