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

View File

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