I created a simple django form with a list of options (in the radio buttons):
class MyForm(forms.Form): choices=forms.ChoiceField( widget=forms.RadioSelect(), choices=[(k,k) for k in ['one','two','three']],label="choose one")
I would like the form to submit automatically when the user selects one of the options. In direct HTML, I would do it like
<select name='myselect' onChange="FORM_NAME.submit();"> .... </select>
But I do not know how to integrate this into a form class without writing a template. In particular, I need to know FORM_NAME , so I can call FORM_NAME.submit() in the above snippet. Can this be done without using a template?
olamundo
source share