Add autofocus to firstname field

This commit is contained in:
2025-07-18 11:34:12 +02:00
parent 1b73b94e07
commit 1a47dd2165

View File

@@ -38,6 +38,11 @@ class RentalCreateForm(forms.ModelForm):
"date_end": DateInput(format=("%Y-%m-%d")), "date_end": DateInput(format=("%Y-%m-%d")),
} }
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) # to get the self.fields set
self.fields["firstname"].autofocus = True
class RentalAdminForm(forms.ModelForm): class RentalAdminForm(forms.ModelForm):
class Meta: class Meta: