how can I declare initial value of radio button?
form.py
YESNO = (
('Yes','Yes'),
('No', 'No'),
)
class MyForm(forms.Form):
like = forms.ChoiceField(widget=forms.RadioSelect, choices=YESNO)
myhtml.html
{{form.like}}
i try to put:
like = forms.ChoiceField(widget=forms.RadioSelect, choices=YESNO, initial={'Yes':'Yes'})
when i run my code, my radio button has not yet selected..
i put the initial value direct in my
views.py…