diff --git a/docs/topics/html-and-forms.md b/docs/topics/html-and-forms.md index 6660607fe..f77ae3af7 100644 --- a/docs/topics/html-and-forms.md +++ b/docs/topics/html-and-forms.md @@ -108,7 +108,7 @@ Let's take a look at how to render each of the three available template packs. F class LoginSerializer(serializers.Serializer): email = serializers.EmailField( max_length=100, - style={'placeholder': 'Email'} + style={'placeholder': 'Email', 'autofocus': True} ) password = serializers.CharField( max_length=100, @@ -207,9 +207,9 @@ Field templates can also use additional style properties, depending on their typ The complete list of `base_template` options and their associated style options is listed below. -base_template | Valid field types | Additional style options +base_template | Valid field types | Additional style options ----|----|---- -input.html | Any string, numeric or date/time field | input_type, placeholder, hide_label +input.html | Any string, numeric or date/time field | input_type, placeholder, hide_label, autofocus textarea.html | `CharField` | rows, placeholder, hide_label select.html | `ChoiceField` or relational field types | hide_label radio.html | `ChoiceField` or relational field types | inline, hide_label diff --git a/rest_framework/templates/rest_framework/horizontal/input.html b/rest_framework/templates/rest_framework/horizontal/input.html index 9e5bbd0f7..a6d657d7d 100644 --- a/rest_framework/templates/rest_framework/horizontal/input.html +++ b/rest_framework/templates/rest_framework/horizontal/input.html @@ -6,7 +6,7 @@ {% endif %}