M
M
mspuz2022-03-31 19:25:36
Template Engines
mspuz, 2022-03-31 19:25:36

Python + chameleon - select block output?

I use chameleon template engine. I can’t figure out how to make an active item in the block.

Here is the code I have:

<select class="form-select" name="timezone" required>
                      <option tal:repeat="item range(-12, 13)" value="${ item }">${ item }</option>
                  </select>


Here I have a dropdown list, the parameter is also passed, what is the timezone, how can I add the selected attribute depending on what the passed parameter is equal to?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question