Ticket #4961: newforms.diff
File newforms.diff, 770 bytes (added by , 17 years ago) |
---|
-
docs/newforms.txt
1325 1325 senders = MultiEmailField() 1326 1326 cc_myself = forms.BooleanField() 1327 1327 1328 Adding HTML attributes to the widget 1329 ------------------------------------ 1330 1331 If you want to add HTML attributes to the widget of a field, you need add 1332 them to the dictionary ``attrs``:: 1333 1334 class ActionForm(forms.Form): 1335 action=forms.ChoiceField(choices=( 1336 ("", "---"), 1337 ("edit", "Bearbeiten"), 1338 ("delete", "Delete")) 1339 action.widget.attrs["onchange"]="this.form.submit()" 1340 1341 1328 1342 Generating forms for models 1329 1343 =========================== 1330 1344