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>
And this is what i want to show, keeping the function I assigned(onclick that call the modal)