Friday, October 21, 2016

Re: Tutorial part 4 help: the raidio buttons to make a choice on the polls question won't show.

I think the problem is from around:

 {% for choice in question.choice_set.all %}
<input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" />
<label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label><br />
{% endfor %}

This is because i tested outside the loop and i got the radio button,  but the whole idea was to loop through the questions and assign a button for the choices.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/529b45cc-c1ec-46d8-90eb-26c30aad2989%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment