File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
djangoproject/templates/contact Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 17
17
class BaseContactForm (ContactForm ):
18
18
message_subject = forms .CharField (
19
19
max_length = 100 ,
20
- widget = forms .TextInput (
21
- attrs = {"class" : "required" , "placeholder" : _ ("Message subject" )}
22
- ),
20
+ widget = forms .TextInput (attrs = {"class" : "required" }),
23
21
label = _ ("Message subject" ),
24
22
)
25
23
email = forms .EmailField (
26
- widget = forms .TextInput (attrs = {"class" : "required" , "placeholder" : _ ("E-mail" )})
24
+ widget = forms .TextInput (attrs = {"class" : "required" }),
25
+ label = _ ("E-mail" ),
27
26
)
28
27
name = forms .CharField (
29
- widget = forms .TextInput (attrs = {"class" : "required" , "placeholder" : _ ("Name" )})
28
+ widget = forms .TextInput (attrs = {"class" : "required" }),
29
+ label = _ ("Name" ),
30
30
)
31
31
body = forms .CharField (
32
- widget = forms .Textarea (
33
- attrs = {"class" : "required" , "placeholder" : _ ("Your message" )}
34
- )
32
+ widget = forms .Textarea (attrs = {"class" : "required" }),
33
+ label = _ ("Your message" ),
35
34
)
36
35
captcha = ReCaptchaField (widget = ReCaptchaV3 )
37
36
Original file line number Diff line number Diff line change @@ -32,18 +32,22 @@ <h1>{% translate "Contact the Django Software Foundation" %}</h1>
32
32
< form action =". " method ="post " accept-charset ="utf-8 " class ="form-input ">
33
33
{% csrf_token %}
34
34
< p >
35
+ < label for ="{{ form.name.id_for_label }} "> {{ form.name.label }}</ label >
35
36
{% if form.name.errors %}< p class ="errors "> {{ form.name.errors.as_text }}</ p > {% endif %}
36
37
{{ form.name }}
37
38
</ p >
38
39
< p class ="form-email ">
40
+ < label for ="{{ form.email.id_for_label }} "> {{ form.email.label }}</ label >
39
41
{% if form.email.errors %}< p class ="errors "> {{ form.email.errors.as_text }}</ p > {% endif %}
40
42
{{ form.email }}
41
43
</ p >
42
44
< p >
45
+ < label for ="{{ form.message_subject.id_for_label }} "> {{ form.message_subject.label }}</ label >
43
46
{% if form.message_subject.errors %}< p class ="errors "> {{ form.message_subject.errors.as_text }}</ p > {% endif %}
44
47
{{ form.message_subject }}
45
48
</ p >
46
49
< p >
50
+ < label for ="{{ form.body.id_for_label }} "> {{ form.body.label }}</ label >
47
51
{% if form.body.errors %}< p class ="errors "> {{ form.body.errors.as_text }}</ p > {% endif %}
48
52
{{ form.body }}
49
53
</ p >
You can’t perform that action at this time.
0 commit comments