django dropdownlist onchange submission

django, html, html-select, javascript, python

Solution

solved following this link

days = forms.ModelChoiceField(queryset=Day.objects.all().order_by('alias'), widget=forms.Select(attrs={"onChange":'refresh()'}))

Problem

I am showing to the user a dropdown list from this form: ``` class CronForm(forms.Form): days = forms.ModelChoiceField(queryset=Day.objects.all().order_by('day')) class Day(models.Model): day = models.CharField(max_length=200, default='') month = models.CharField(max_length=200, default='') def __unicode__(self): return self.day ``` And It is shown at the template this way: ``` <form method="post" onchange=change()> {{ days }} </form> ``` What I want is to submit this form when the user selects an option from the dropdown list. For example, the user could be redirected to a new url, and internally the program would capture the POST data. But everything I find is related to the `<select>` tag, like calling a javascript function onchange of the select element. But as the select element is IN the ModelChoiceField form, I don't know how to do it. Any help would be very appreciated!

Original source