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

131
Views
How to select sliders and save info of the input fields to commit on PostgrelSQL

So I have a page with the following: (1) Text field = Title, (2) Dropdown (3) Text Field = Description. Also on that page I have a table that is filled with the info on a PostgreSQL table and the query is done in a .py with Flask and SQLAlchemy. Every line of the table has a slider that the user can click. When the user click on the submit button all the info that was filled need to go to the corresponding tables in the DB and if there is any sliders with status == checked that info needs to go to the table of the DB as well. I was getting the text fields and dropdown using cookies and I did try to verify if the status of the sliders are checked but so far didn't work.

Any tips about how to do this work? Is there a better way to do this besides using cookies? Thanks in advance c; I'm using HTML, Bootstrap5, Javascript, Flask, SQLAlchemy and Jinja2

HTML
                {% for e in inves %}
                <tr>
                  <td>{{ e[0] }}</td>
                  <td>{{ e[1] }}</td>
                  <td>
                    <label class="switch">
                        <input type="checkbox" id = "checkbox_inves_{{loop.index}}">
                        <span class="slider round"></span>
                    </label>
                  </td>
                </tr>
                {% endfor %}
const switchs = document.querySelectorAll(".switch");
switchs.forEach(s => {

  s.querySelector("slider round").addEventListener("click", e => {

    if (e.checked){
      console.log("checked:" + e.target.id)
    }else{
      console.log("unchecked:" + e.target.id)
    }

  });
});
about 4 years ago · Santiago Trujillo
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!