Repository: cisagov/manage.get.gov

Issue:
Domain Mgmt: Refine error messages to be more specific
### Issue Description

Individual error messages appear at the top of the page when a field is left blank. But—on some pages of the Domain Mgmt section—those messages are generic ("This field is required"). Therefore, the individual messages are not useful. The following pages have generic error messages: 


- Authorizing Official
- Your Contact Information



![Image](https://github.com/cisagov/getgov/assets/119689946/b5eeafef-57e4-48ff-bce9-d158bda911cb)



### Additional Context (optional)

Update the error messages to be more specific to the required field on these pages: 

- DNS name servers
- Authorizing Official
- Your Contact Information

### Issue Links

_No response_


Discussion:
Can move to 32/33 if necessary
We have [error messages for fields that are used in the domain request form](https://docs.google.com/document/d/1EHMzgmig6vaSFRvCiih87Cx38lD2rWrkEE4BzDzev9Q/edit#heading=h.3j2qqm3). Hopefully we can reuse those.

Resolving patch:
diff --git a/src/registrar/forms/__init__.py b/src/registrar/forms/__init__.py
--- a/src/registrar/forms/__init__.py
+++ b/src/registrar/forms/__init__.py
@@ -5,6 +5,7 @@
     DomainSecurityEmailForm,
     DomainOrgNameAddressForm,
     ContactForm,
+    AuthorizingOfficialContactForm,
     DomainDnssecForm,
     DomainDsdataFormset,
     DomainDsdataForm,
diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py
--- a/src/registrar/forms/domain.py
+++ b/src/registrar/forms/domain.py
@@ -148,6 +148,40 @@ def __init__(self, *args, **kwargs):
         for field_name in self.required:
             self.fields[field_name].required = True
 
+        # Set custom error messages
+        self.fields["first_name"].error_messages = {"required": "Enter your first name / given name."}
+        self.fields["last_name"].error_messages = {"required": "Enter your last name / family name."}
+        self.fields["title"].error_messages = {
+            "required": "Enter your title or role in your organization (e.g., Chief Information Officer)"
+        }
+        self.fields["email"].error_messages = {
+            "required": "Enter your email address in the required format, like name@example.com."
+        }
+        self.fields["phone"].error_messages = {"required": "Enter your phone number."}
+
+
+class AuthorizingOfficialContactForm(ContactForm):
+    """Form for updating authorizing official contacts."""
+
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+
+        # Set custom error messages
+        self.fields["first_name"].error_messages = {
+            "required": "Enter the first name / given name of your authorizing official."
+        }
+        self.fields["last_name"].error_messages = {
+            "required": "Enter the last name / family name of your authorizing official."
+        }
+        self.fields["title"].error_messages = {
+            "required": "Enter the title or role your authorizing official has in your \
+            organization (e.g., Chief Information Officer)."
+        }
+        self.fields["email"].error_messages = {
+            "required": "Enter an email address in the required format, like name@example.com."
+        }
+        self.fields["phone"].error_messages = {"required": "Enter a phone number for your authorizing official."}
+
 
 class DomainSecurityEmailForm(forms.Form):
     """Form for adding or editing a security email to a domain."""
diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py
--- a/src/registrar/views/domain.py
+++ b/src/registrar/views/domain.py
@@ -33,6 +33,7 @@
 
 from ..forms import (
     ContactForm,
+    AuthorizingOfficialContactForm,
     DomainOrgNameAddressForm,
     DomainAddUserForm,
     DomainSecurityEmailForm,
@@ -182,7 +183,7 @@ class DomainAuthorizingOfficialView(DomainFormBaseView):
     model = Domain
     template_name = "domain_authorizing_official.html"
     context_object_name = "domain"
-    form_class = ContactForm
+    form_class = AuthorizingOfficialContactForm
 
     def get_form_kwargs(self, *args, **kwargs):
         """Add domain_info.authorizing_official instance to make a bound form."""


Test patch: