slider input ranges in html with min and max values inside a table and a for loop

30 views Asked by At

I'm a newbie and battling my first issues with Django, html, js and so on.. I wonder if anyone can help me out here.

I have a page where you must enter a series of ranges of attendances and prices for a movie center. If you purchase entrances to a movie if you go to the movies once you pay 8, if you plan to go from 2 to 5 times you pay 20 but if you plan to go 6 to 10 times you pay 30.

what I'm getting is this

The thing is that the list will grow every time you make a new range of prices. I can forsee someone adding another range from 11 to 20 times and paying 35$. `

#visit range

                    <th scope="col">Precio</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                {% for cuota in cuotas %}
                <tr> 
                    <td><input name="range" id="range" min="0" max="100" value="0" type="range"></div>
                    <td><a class="price">{{ cuota.price }}</a></td>
                    <td style="text-align: right">
                        <button type="button" class="btn btn-secondary btn-xs text-align-right"><i class="fas fa-edit"></i></button>
                        <button type="button" class="btn btn-secondary btn-xs"><i class="fas fa-trash-alt"></i></button>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>`

The thing here is that the list will grow and I should have an unique ID for each slider and so on.

How would you solve this?

0

There are 0 answers