mercredi 9 novembre 2022

delete row when multiple checkboxes are selected, in flask generated website

I am trying to make a to-do list with sub-tasks which are generated by a form which ask the user for the task name and sub-task names. Then I displayed the sub-tasks with the help of jinja template, but I want to be able to delete the row of the table that is the task when all three checkboxes are selected

                <form action="/delete" method="post" id = "x">

                  <div class="form-check">
                    <input class="form-check-input" type="checkbox" name= 'sub_task1' value=  id="flexCheckDefault">
                    <label class="form-check-label" for="flexCheckDefault">
                      
                    </label>
                  </div>
                  <div class="form-check">
                    <input class="form-check-input" type="checkbox" name='sub_task2' value=  id="flexCheckDefault">
                    <label class="form-check-label" for="flexCheckDefault">
                      
                    </label>
                  </div>
                  <div class="form-check">
                    <input class="form-check-input" type="checkbox" name=sub_task3 value=  id="flexCheckDefault">
                    <label class="form-check-label" for="flexCheckDefault">
                      
                    </label>
                </form>

I do not want to create a submit button , so I thought of using get,ElementById function but as it is a jinja template knowing before hand what the id is not possible. Is there any way to implement it

I tried using wtforms but I reached a dead end there.




Aucun commentaire:

Enregistrer un commentaire