Skip to content

Commit

Permalink
Disable autocomplete on datetime form fields (#224)
Browse files Browse the repository at this point in the history
The actual issue here is that the readonly property is no longer working. This
should be fixed in a separate commit.
  • Loading branch information
cdubz committed Jun 19, 2021
1 parent d8cb7bb commit a2da7e3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/forms.py
Expand Up @@ -94,6 +94,7 @@ class Meta:
fields.append('picture')
widgets = {
'birth_date': forms.DateInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_date',
}),
Expand Down Expand Up @@ -126,6 +127,7 @@ class Meta:
fields = ['child', 'time', 'wet', 'solid', 'color', 'amount', 'notes']
widgets = {
'time': forms.DateTimeInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_time',
}),
Expand All @@ -139,10 +141,12 @@ class Meta:
fields = ['child', 'start', 'end', 'type', 'method', 'amount', 'notes']
widgets = {
'start': forms.DateTimeInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_start',
}),
'end': forms.DateTimeInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_end',
}),
Expand All @@ -156,6 +160,7 @@ class Meta:
fields = ['child', 'note', 'time']
widgets = {
'time': forms.DateTimeInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_time',
}),
Expand All @@ -168,10 +173,12 @@ class Meta:
fields = ['child', 'start', 'end', 'notes']
widgets = {
'start': forms.DateTimeInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_start',
}),
'end': forms.DateTimeInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_end',
}),
Expand All @@ -185,6 +192,7 @@ class Meta:
fields = ['child', 'temperature', 'time', 'notes']
widgets = {
'time': forms.DateTimeInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_time',
}),
Expand All @@ -198,6 +206,7 @@ class Meta:
fields = ['child', 'name', 'start']
widgets = {
'start': forms.DateTimeInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_start',
})
Expand All @@ -220,10 +229,12 @@ class Meta:
fields = ['child', 'start', 'end', 'milestone']
widgets = {
'start': forms.DateTimeInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_start',
}),
'end': forms.DateTimeInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_end',
}),
Expand All @@ -236,6 +247,7 @@ class Meta:
fields = ['child', 'weight', 'date', 'notes']
widgets = {
'date': forms.DateInput(attrs={
'autocomplete': 'off',
'readonly': 'readonly',
'data-target': '#datetimepicker_date',
}),
Expand Down

0 comments on commit a2da7e3

Please sign in to comment.