Fix validation on character count, increase charater count to 1000 on textareas, increase textarea height on desktop

This commit is contained in:
rachidatecs 2023-05-09 13:15:09 -04:00
parent 9183166866
commit d8df2877f4
No known key found for this signature in database
GPG key ID: 3CEBBFA7325E5525
5 changed files with 34 additions and 4 deletions

View file

@ -5,7 +5,7 @@ from typing import Callable
from phonenumber_field.formfields import PhoneNumberField # type: ignore
from django import forms
from django.core.validators import RegexValidator
from django.core.validators import RegexValidator, MaxLengthValidator
from django.urls import reverse
from django.utils.safestring import mark_safe
@ -315,6 +315,12 @@ class TypeOfWorkForm(RegistrarForm):
# label has to end in a space to get the label_suffix to show
label="What type of work does your organization do? ",
widget=forms.Textarea(),
validators=[
MaxLengthValidator(
1000,
message="Response must be less than 1000 characters",
)
],
error_messages={"required": "Enter the type of work your organization does."},
)
@ -327,6 +333,12 @@ class TypeOfWorkForm(RegistrarForm):
" support your claims. "
),
widget=forms.Textarea(),
validators=[
MaxLengthValidator(
1000,
message="Response must be less than 1000 characters",
)
],
error_messages={
"required": (
"Describe how your organization is independent of a state government."
@ -554,6 +566,12 @@ class PurposeForm(RegistrarForm):
purpose = forms.CharField(
label="Purpose",
widget=forms.Textarea(),
validators=[
MaxLengthValidator(
1000,
message="Response must be less than 1000 characters",
)
],
error_messages={
"required": "Describe how you'll use the .gov domain youre requesting."
},
@ -696,6 +714,12 @@ class AnythingElseForm(RegistrarForm):
required=False,
label="Anything else we should know?",
widget=forms.Textarea(),
validators=[
MaxLengthValidator(
1000,
message="Response must be less than 1000 characters",
)
]
)