add autofocus and autocomplete to user form field, #104

This commit is contained in:
simon 2021-12-16 18:00:36 +07:00
parent 5b59c3296f
commit ada2c1fe59
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 8 additions and 1 deletions

View File

@ -11,7 +11,14 @@ class CustomAuthForm(AuthenticationForm):
"""better styled login form"""
username = forms.CharField(
widget=TextInput(attrs={"placeholder": "Username"}), label=False
widget=TextInput(
attrs={
"placeholder": "Username",
"autofocus": True,
"autocomplete": True,
}
),
label=False,
)
password = forms.CharField(
widget=PasswordInput(attrs={"placeholder": "Password"}), label=False