Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

114
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda