1
    <select id="_count_id">
        {% for item in list_count %}
            <option value="{{ item }}" {% if item==count %}selected="selected"{% endif %}>{{ item }}</option>
        {% endfor %}
    </select>

嗯,使用上面的代码将选定的值设置为 html 下拉列表,尽管它不起作用。count 是一个数字值,item 是从 1 到 99 的任何值。我不知道我在哪里做错了什么。任何人都可以帮忙吗?先感谢您

4

1 回答 1

0

I get this error when running it

Exception Value: Could not parse the remainder: '==count' from 'item==count'

If changing it to item == count (with spaces around '=='), it works.

于 2012-11-13T14:38:14.987 回答