Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

108
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!