diff options
Diffstat (limited to 'docs/ref/forms/widgets.txt')
| -rw-r--r-- | docs/ref/forms/widgets.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index 98383b89dd..ac16b3c02a 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -163,6 +163,9 @@ Django will then include the extra attributes in the rendered output: <tr><th>Url:</th><td><input type="text" name="url"/></td></tr> <tr><th>Comment:</th><td><input type="text" name="comment" size="40"/></td></tr> +You can also set the HTML ``id`` using :attr:`~Widget.attrs`. See +:attr:`BoundField.id_for_label` for an example. + .. _styling-widget-classes: Styling widget classes @@ -249,6 +252,8 @@ foundation for custom widgets. :class:`~datetime.datetime` value into a list with date and time split into two separate values:: + from django.forms import MultiWidget + class SplitDateTimeWidget(MultiWidget): # ... |
