Am Dienstag, 24. Juli 2007 10:32 schrieb Thomas Guettler: > Hi, > > how can I pass the html attribute onchange="..." with newforms?
I found one solution myself: http://code.djangoproject.com/attachment/ticket/4961/newforms.diff#preview Adding HTML attributes to the widget ------------------------------------ If you want to add HTML attributes to the widget of a field, you need add them to the dictionary ``attrs``:: class ActionForm(forms.Form): action=forms.ChoiceField(choices=( ("", "---"), ("edit", "Bearbeiten"), ("delete", "Delete")) action.widget.attrs["onchange"]="this.form.submit()" Thomas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---