I am unable to get round toggle in my django template

Viewed 74

I have a table which contains for loop and if tag using jinja this table shows some data but in last column I want round toggle button but I only get a checkbox, I am unable to find the error please help me.

<tbody>
        {%for student in students%}
        {%if user.staff.class_coordinator_of  == student.division and user.staff.teacher_of_year == student.year%}
      <tr>
        <td style="color:white;">{{student.user.first_name}}</td>
        <td style="color:white;">{{student.user.last_name}}</td>
        <td style="color:white;">{{student.year}}</td>
        <td style="color:white;">{{student.division}}</td>
        <td style="color:white;">{{student.batch}}</td>
        <td>
            <label class="switch ">
                <input type="checkbox" id="" value="" checked>
                <span class="slider round"></span>
                </label>                 
        </td>
      </tr>
      {%  endif %}
      
      {%endfor%}
    </tbody>

OUTPUT

Output Image

1 Answers

You should use radio button instead of checkbox so, it should be type="radio".

<input type="radio" id="" value="" checked>
Related