Reputation: 461
I have a variable page.stock which is set on the load as the string "3,4,5,6".
I want to loop through this variable. I tried:
{% for mysize in app.request.get(page.stock) %}
<input type="radio" id="{{mysize}}" name="size" value="{{mysize}}" >
<label for="{{mysize}}">{{mysize}}</label>
{% endfor %}
and I also tried:
{% for mysize in page.stock %}
<input type="radio" id="{{mysize}}" name="size" value="{{mysize}}" >
<label for="{{mysize}}">{{mysize}}</label>
{% endfor %}
Both with no luck. How do I iterate through the ,
delimited string?
Upvotes: 5
Views: 4270