Since each form is set to only allow you to select 1 multiple choice option, if I add many forms in one page, I can only select one option overall. So if I answer question 1, I can't answer any of the other questions without it unselecting question 1's answer.Does anyone know how to fix this?
class PollForm(forms.Form): answer = forms.ChoiceField( widget=forms.RadioSelect, choices=cool_choices)
def __init__(self, poll, *args, **kwargs): super(PollForm, self).__init__(*args, **kwargs) b = poll.choice_set.all() list_choice = [] for i in range(len(b)): list_choice.append(b[i].choice)
list_choice = zip(list_choice, list_choice) self.fields['answer'].choices = list_choice self.fields['answer'].label = poll.question
self.fields[poll.pk] = self.fields['answer'] del self.fields['answer']