We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Form field validation: update copy to be more specific on the problem

![image](https://github.com/cal-itp/benefits/assets/25497886/239f1560-3fb5-4031-91f2-944b736620b3)

![image](https://github.com/cal-itp/benefits/assets/25497886/e3ad07da-d36a-40de-9c9c-399d510b722f)


## Acceptance Criteria

- [x] Configure the browser validation message - https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation#controlling_the_text_of_constraint_violation
- [x] Test with different browser locales
- [x] Add custom copy for both Eligibility Index (radio buttons) and Eligibility Confirm (text fields)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `benefits/eligibility/forms.py`
Content:
```
1 """
2 The eligibility application: Form definition for the eligibility verification flow.
3 """
4 
5 import logging
6 
7 from django import forms
8 from django.utils.translation import gettext_lazy as _
9 
10 from benefits.core import models, recaptcha, widgets
11 
12 logger = logging.getLogger(__name__)
13 
14 
15 class EligibilityVerifierSelectionForm(forms.Form):
16     """Form to capture eligibility verifier selection."""
17 
18     action_url = "eligibility:index"
19     id = "form-verifier-selection"
20     method = "POST"
21 
22     verifier = forms.ChoiceField(label="", widget=widgets.VerifierRadioSelect)
23     # sets label to empty string so the radio_select template can override the label style
24     submit_value = _("Choose this benefit")
25 
26     def __init__(self, agency: models.TransitAgency, *args, **kwargs):
27         super().__init__(*args, **kwargs)
28         verifiers = agency.active_verifiers
29 
30         self.classes = "col-lg-8"
31         # second element is not used since we render the whole label using selection_label_template,
32         # therefore set to None
33         self.fields["verifier"].choices = [(v.id, None) for v in verifiers]
34         self.fields["verifier"].widget.selection_label_templates = {v.id: v.selection_label_template for v in verifiers}
35 
36     def clean(self):
37         if not recaptcha.verify(self.data):
38             raise forms.ValidationError("reCAPTCHA failed")
39 
40 
41 class EligibilityVerificationForm(forms.Form):
42     """Form to collect eligibility verification details."""
43 
44     action_url = "eligibility:confirm"
45     id = "form-eligibility-verification"
46     method = "POST"
47 
48     submit_value = _("Find my record")
49     submitting_value = _("Checking")
50 
51     _error_messages = {
52         "invalid": _("Check your input. The format looks wrong."),
53         "missing": _("This field is required."),
54     }
55 
56     def __init__(
57         self,
58         title,
59         headline,
60         blurb,
61         name_label,
62         name_placeholder,
63         name_help_text,
64         sub_label,
65         sub_placeholder,
66         sub_help_text,
67         name_max_length=None,
68         sub_input_mode=None,
69         sub_max_length=None,
70         sub_pattern=None,
71         *args,
72         **kwargs,
73     ):
74         """Initialize a new EligibilityVerifier form.
75 
76         Args:
77             title (str): The page (i.e. tab) title for the form's page.
78 
79             headline (str): The <h1> on the form's page.
80 
81             blurb (str): Intro <p> on the form's page.
82 
83             name_label (str): Label for the name form field.
84 
85             name_placeholder (str): Field placeholder for the name form field.
86 
87             name_help_text (str): Extra help text for the name form field.
88 
89             sub_label (str): Label for the sub form field.
90 
91             sub_placeholder (str): Field placeholder for the sub form field.
92 
93             sub_help_text (str): Extra help text for the sub form field.
94 
95             name_max_length (int): The maximum length accepted for the 'name' API field before sending to this verifier
96 
97             sub_input_mode (str): Input mode can be "numeric", "tel", "search", etc. to override default "text" keyboard on
98                                   mobile devices
99 
100             sub_max_length (int): The maximum length accepted for the 'sub' API field before sending to this verifier
101 
102             sub_pattern (str): A regular expression used to validate the 'sub' API field before sending to this verifier
103 
104         Extra args and kwargs are passed through to the underlying django.forms.Form.
105         """
106         super().__init__(auto_id=True, label_suffix="", *args, **kwargs)
107 
108         self.title = title
109         self.headline = headline
110         self.blurb = blurb
111 
112         self.classes = "col-lg-6"
113         sub_widget = widgets.FormControlTextInput(placeholder=sub_placeholder)
114         if sub_pattern:
115             sub_widget.attrs.update({"pattern": sub_pattern})
116         if sub_input_mode:
117             sub_widget.attrs.update({"inputmode": sub_input_mode})
118         if sub_max_length:
119             sub_widget.attrs.update({"maxlength": sub_max_length})
120 
121         self.fields["sub"] = forms.CharField(
122             label=sub_label,
123             widget=sub_widget,
124             help_text=sub_help_text,
125         )
126 
127         name_widget = widgets.FormControlTextInput(placeholder=name_placeholder)
128         if name_max_length:
129             name_widget.attrs.update({"maxlength": name_max_length})
130 
131         self.fields["name"] = forms.CharField(label=name_label, widget=name_widget, help_text=name_help_text)
132 
133     def clean(self):
134         if not recaptcha.verify(self.data):
135             raise forms.ValidationError("reCAPTCHA failed")
136 
137 
138 class MSTCourtesyCard(EligibilityVerificationForm):
139     """EligibilityVerification form for the MST Courtesy Card."""
140 
141     def __init__(self, *args, **kwargs):
142         super().__init__(
143             title=_("Agency card information"),
144             headline=_("Let’s find the record of your transit benefit."),
145             blurb=_(
146                 "We use the information on your MST Courtesy Card to find the record of your transit benefit in our system."
147             ),
148             name_label=_("Last Name"),
149             name_placeholder="Garcia",
150             name_help_text=_(
151                 "Please enter your last name the same way it is printed on your card, including capital letters and hyphens."
152             ),
153             sub_label=_("Courtesy Card number"),
154             sub_help_text=_("This is a 5-digit number on the front and back of your card."),
155             sub_placeholder="12345",
156             name_max_length=255,
157             sub_input_mode="numeric",
158             sub_max_length=5,
159             sub_pattern=r"\d{5}",
160             *args,
161             **kwargs,
162         )
163 
164 
165 class SBMTDMobilityPass(EligibilityVerificationForm):
166     """EligibilityVerification form for the SBMTD Reduced Fare Mobility ID."""
167 
168     def __init__(self, *args, **kwargs):
169         super().__init__(
170             title=_("Agency card information"),
171             headline=_("Let’s find the record of your transit benefit."),
172             blurb=_(
173                 "We use the information on your SBMTD Reduced Fare Mobility ID card to find the record of your transit "
174                 + "benefit in our system."
175             ),
176             name_label=_("Last Name"),
177             name_placeholder="Garcia",
178             name_help_text=_(
179                 "Please enter your last name the same way it is printed on your card, including capital letters and hyphens."
180             ),
181             sub_label=_("Reduced Fare Mobility ID card number"),
182             sub_help_text=_("This is a 4-digit number on the back of your card."),
183             sub_placeholder="1234",
184             name_max_length=255,
185             sub_input_mode="numeric",
186             sub_max_length=4,
187             sub_pattern=r"\d{4}",
188             *args,
189             **kwargs,
190         )
191
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/benefits/eligibility/forms.py b/benefits/eligibility/forms.py
--- a/benefits/eligibility/forms.py
+++ b/benefits/eligibility/forms.py
@@ -30,8 +30,11 @@
         self.classes = "col-lg-8"
         # second element is not used since we render the whole label using selection_label_template,
         # therefore set to None
-        self.fields["verifier"].choices = [(v.id, None) for v in verifiers]
-        self.fields["verifier"].widget.selection_label_templates = {v.id: v.selection_label_template for v in verifiers}
+        verifier_field = self.fields["verifier"]
+        verifier_field.choices = [(v.id, None) for v in verifiers]
+        verifier_field.widget.selection_label_templates = {v.id: v.selection_label_template for v in verifiers}
+        verifier_field.widget.attrs.update({"data-custom-validity": _("Please choose a transit benefit.")})
+        self.use_custom_validity = True
 
     def clean(self):
         if not recaptcha.verify(self.data):
@@ -48,11 +51,6 @@
     submit_value = _("Find my record")
     submitting_value = _("Checking")
 
-    _error_messages = {
-        "invalid": _("Check your input. The format looks wrong."),
-        "missing": _("This field is required."),
-    }
-
     def __init__(
         self,
         title,
@@ -68,6 +66,8 @@
         sub_input_mode=None,
         sub_max_length=None,
         sub_pattern=None,
+        sub_custom_validity=None,
+        name_custom_validity=None,
         *args,
         **kwargs,
     ):
@@ -117,6 +117,9 @@
             sub_widget.attrs.update({"inputmode": sub_input_mode})
         if sub_max_length:
             sub_widget.attrs.update({"maxlength": sub_max_length})
+        if sub_custom_validity:
+            sub_widget.attrs.update({"data-custom-validity": sub_custom_validity})
+            self.use_custom_validity = True
 
         self.fields["sub"] = forms.CharField(
             label=sub_label,
@@ -127,6 +130,9 @@
         name_widget = widgets.FormControlTextInput(placeholder=name_placeholder)
         if name_max_length:
             name_widget.attrs.update({"maxlength": name_max_length})
+        if name_custom_validity:
+            name_widget.attrs.update({"data-custom-validity": name_custom_validity})
+            self.use_custom_validity = True
 
         self.fields["name"] = forms.CharField(label=name_label, widget=name_widget, help_text=name_help_text)
 
@@ -157,6 +163,8 @@
             sub_input_mode="numeric",
             sub_max_length=5,
             sub_pattern=r"\d{5}",
+            sub_custom_validity=_("Please enter a 5-digit number."),
+            name_custom_validity=_("Please enter your last name."),
             *args,
             **kwargs,
         )
@@ -185,6 +193,8 @@
             sub_input_mode="numeric",
             sub_max_length=4,
             sub_pattern=r"\d{4}",
+            sub_custom_validity=_("Please enter a 4-digit number."),
+            name_custom_validity=_("Please enter your last name."),
             *args,
             **kwargs,
         )

{"golden_diff": "diff --git a/benefits/eligibility/forms.py b/benefits/eligibility/forms.py\n--- a/benefits/eligibility/forms.py\n+++ b/benefits/eligibility/forms.py\n@@ -30,8 +30,11 @@\n         self.classes = \"col-lg-8\"\n         # second element is not used since we render the whole label using selection_label_template,\n         # therefore set to None\n-        self.fields[\"verifier\"].choices = [(v.id, None) for v in verifiers]\n-        self.fields[\"verifier\"].widget.selection_label_templates = {v.id: v.selection_label_template for v in verifiers}\n+        verifier_field = self.fields[\"verifier\"]\n+        verifier_field.choices = [(v.id, None) for v in verifiers]\n+        verifier_field.widget.selection_label_templates = {v.id: v.selection_label_template for v in verifiers}\n+        verifier_field.widget.attrs.update({\"data-custom-validity\": _(\"Please choose a transit benefit.\")})\n+        self.use_custom_validity = True\n \n     def clean(self):\n         if not recaptcha.verify(self.data):\n@@ -48,11 +51,6 @@\n     submit_value = _(\"Find my record\")\n     submitting_value = _(\"Checking\")\n \n-    _error_messages = {\n-        \"invalid\": _(\"Check your input. The format looks wrong.\"),\n-        \"missing\": _(\"This field is required.\"),\n-    }\n-\n     def __init__(\n         self,\n         title,\n@@ -68,6 +66,8 @@\n         sub_input_mode=None,\n         sub_max_length=None,\n         sub_pattern=None,\n+        sub_custom_validity=None,\n+        name_custom_validity=None,\n         *args,\n         **kwargs,\n     ):\n@@ -117,6 +117,9 @@\n             sub_widget.attrs.update({\"inputmode\": sub_input_mode})\n         if sub_max_length:\n             sub_widget.attrs.update({\"maxlength\": sub_max_length})\n+        if sub_custom_validity:\n+            sub_widget.attrs.update({\"data-custom-validity\": sub_custom_validity})\n+            self.use_custom_validity = True\n \n         self.fields[\"sub\"] = forms.CharField(\n             label=sub_label,\n@@ -127,6 +130,9 @@\n         name_widget = widgets.FormControlTextInput(placeholder=name_placeholder)\n         if name_max_length:\n             name_widget.attrs.update({\"maxlength\": name_max_length})\n+        if name_custom_validity:\n+            name_widget.attrs.update({\"data-custom-validity\": name_custom_validity})\n+            self.use_custom_validity = True\n \n         self.fields[\"name\"] = forms.CharField(label=name_label, widget=name_widget, help_text=name_help_text)\n \n@@ -157,6 +163,8 @@\n             sub_input_mode=\"numeric\",\n             sub_max_length=5,\n             sub_pattern=r\"\\d{5}\",\n+            sub_custom_validity=_(\"Please enter a 5-digit number.\"),\n+            name_custom_validity=_(\"Please enter your last name.\"),\n             *args,\n             **kwargs,\n         )\n@@ -185,6 +193,8 @@\n             sub_input_mode=\"numeric\",\n             sub_max_length=4,\n             sub_pattern=r\"\\d{4}\",\n+            sub_custom_validity=_(\"Please enter a 4-digit number.\"),\n+            name_custom_validity=_(\"Please enter your last name.\"),\n             *args,\n             **kwargs,\n         )\n", "issue": "Form field validation: update copy to be more specific on the problem\n\r\n![image](https://github.com/cal-itp/benefits/assets/25497886/239f1560-3fb5-4031-91f2-944b736620b3)\r\n\r\n![image](https://github.com/cal-itp/benefits/assets/25497886/e3ad07da-d36a-40de-9c9c-399d510b722f)\r\n\r\n\r\n## Acceptance Criteria\r\n\r\n- [x] Configure the browser validation message - https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation#controlling_the_text_of_constraint_violation\r\n- [x] Test with different browser locales\r\n- [x] Add custom copy for both Eligibility Index (radio buttons) and Eligibility Confirm (text fields)\r\n\n", "before_files": [{"content": "\"\"\"\nThe eligibility application: Form definition for the eligibility verification flow.\n\"\"\"\n\nimport logging\n\nfrom django import forms\nfrom django.utils.translation import gettext_lazy as _\n\nfrom benefits.core import models, recaptcha, widgets\n\nlogger = logging.getLogger(__name__)\n\n\nclass EligibilityVerifierSelectionForm(forms.Form):\n    \"\"\"Form to capture eligibility verifier selection.\"\"\"\n\n    action_url = \"eligibility:index\"\n    id = \"form-verifier-selection\"\n    method = \"POST\"\n\n    verifier = forms.ChoiceField(label=\"\", widget=widgets.VerifierRadioSelect)\n    # sets label to empty string so the radio_select template can override the label style\n    submit_value = _(\"Choose this benefit\")\n\n    def __init__(self, agency: models.TransitAgency, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        verifiers = agency.active_verifiers\n\n        self.classes = \"col-lg-8\"\n        # second element is not used since we render the whole label using selection_label_template,\n        # therefore set to None\n        self.fields[\"verifier\"].choices = [(v.id, None) for v in verifiers]\n        self.fields[\"verifier\"].widget.selection_label_templates = {v.id: v.selection_label_template for v in verifiers}\n\n    def clean(self):\n        if not recaptcha.verify(self.data):\n            raise forms.ValidationError(\"reCAPTCHA failed\")\n\n\nclass EligibilityVerificationForm(forms.Form):\n    \"\"\"Form to collect eligibility verification details.\"\"\"\n\n    action_url = \"eligibility:confirm\"\n    id = \"form-eligibility-verification\"\n    method = \"POST\"\n\n    submit_value = _(\"Find my record\")\n    submitting_value = _(\"Checking\")\n\n    _error_messages = {\n        \"invalid\": _(\"Check your input. The format looks wrong.\"),\n        \"missing\": _(\"This field is required.\"),\n    }\n\n    def __init__(\n        self,\n        title,\n        headline,\n        blurb,\n        name_label,\n        name_placeholder,\n        name_help_text,\n        sub_label,\n        sub_placeholder,\n        sub_help_text,\n        name_max_length=None,\n        sub_input_mode=None,\n        sub_max_length=None,\n        sub_pattern=None,\n        *args,\n        **kwargs,\n    ):\n        \"\"\"Initialize a new EligibilityVerifier form.\n\n        Args:\n            title (str): The page (i.e. tab) title for the form's page.\n\n            headline (str): The <h1> on the form's page.\n\n            blurb (str): Intro <p> on the form's page.\n\n            name_label (str): Label for the name form field.\n\n            name_placeholder (str): Field placeholder for the name form field.\n\n            name_help_text (str): Extra help text for the name form field.\n\n            sub_label (str): Label for the sub form field.\n\n            sub_placeholder (str): Field placeholder for the sub form field.\n\n            sub_help_text (str): Extra help text for the sub form field.\n\n            name_max_length (int): The maximum length accepted for the 'name' API field before sending to this verifier\n\n            sub_input_mode (str): Input mode can be \"numeric\", \"tel\", \"search\", etc. to override default \"text\" keyboard on\n                                  mobile devices\n\n            sub_max_length (int): The maximum length accepted for the 'sub' API field before sending to this verifier\n\n            sub_pattern (str): A regular expression used to validate the 'sub' API field before sending to this verifier\n\n        Extra args and kwargs are passed through to the underlying django.forms.Form.\n        \"\"\"\n        super().__init__(auto_id=True, label_suffix=\"\", *args, **kwargs)\n\n        self.title = title\n        self.headline = headline\n        self.blurb = blurb\n\n        self.classes = \"col-lg-6\"\n        sub_widget = widgets.FormControlTextInput(placeholder=sub_placeholder)\n        if sub_pattern:\n            sub_widget.attrs.update({\"pattern\": sub_pattern})\n        if sub_input_mode:\n            sub_widget.attrs.update({\"inputmode\": sub_input_mode})\n        if sub_max_length:\n            sub_widget.attrs.update({\"maxlength\": sub_max_length})\n\n        self.fields[\"sub\"] = forms.CharField(\n            label=sub_label,\n            widget=sub_widget,\n            help_text=sub_help_text,\n        )\n\n        name_widget = widgets.FormControlTextInput(placeholder=name_placeholder)\n        if name_max_length:\n            name_widget.attrs.update({\"maxlength\": name_max_length})\n\n        self.fields[\"name\"] = forms.CharField(label=name_label, widget=name_widget, help_text=name_help_text)\n\n    def clean(self):\n        if not recaptcha.verify(self.data):\n            raise forms.ValidationError(\"reCAPTCHA failed\")\n\n\nclass MSTCourtesyCard(EligibilityVerificationForm):\n    \"\"\"EligibilityVerification form for the MST Courtesy Card.\"\"\"\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(\n            title=_(\"Agency card information\"),\n            headline=_(\"Let\u2019s find the record of your transit benefit.\"),\n            blurb=_(\n                \"We use the information on your MST Courtesy Card to find the record of your transit benefit in our system.\"\n            ),\n            name_label=_(\"Last Name\"),\n            name_placeholder=\"Garcia\",\n            name_help_text=_(\n                \"Please enter your last name the same way it is printed on your card, including capital letters and hyphens.\"\n            ),\n            sub_label=_(\"Courtesy Card number\"),\n            sub_help_text=_(\"This is a 5-digit number on the front and back of your card.\"),\n            sub_placeholder=\"12345\",\n            name_max_length=255,\n            sub_input_mode=\"numeric\",\n            sub_max_length=5,\n            sub_pattern=r\"\\d{5}\",\n            *args,\n            **kwargs,\n        )\n\n\nclass SBMTDMobilityPass(EligibilityVerificationForm):\n    \"\"\"EligibilityVerification form for the SBMTD Reduced Fare Mobility ID.\"\"\"\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(\n            title=_(\"Agency card information\"),\n            headline=_(\"Let\u2019s find the record of your transit benefit.\"),\n            blurb=_(\n                \"We use the information on your SBMTD Reduced Fare Mobility ID card to find the record of your transit \"\n                + \"benefit in our system.\"\n            ),\n            name_label=_(\"Last Name\"),\n            name_placeholder=\"Garcia\",\n            name_help_text=_(\n                \"Please enter your last name the same way it is printed on your card, including capital letters and hyphens.\"\n            ),\n            sub_label=_(\"Reduced Fare Mobility ID card number\"),\n            sub_help_text=_(\"This is a 4-digit number on the back of your card.\"),\n            sub_placeholder=\"1234\",\n            name_max_length=255,\n            sub_input_mode=\"numeric\",\n            sub_max_length=4,\n            sub_pattern=r\"\\d{4}\",\n            *args,\n            **kwargs,\n        )\n", "path": "benefits/eligibility/forms.py"}], "after_files": [{"content": "\"\"\"\nThe eligibility application: Form definition for the eligibility verification flow.\n\"\"\"\n\nimport logging\n\nfrom django import forms\nfrom django.utils.translation import gettext_lazy as _\n\nfrom benefits.core import models, recaptcha, widgets\n\nlogger = logging.getLogger(__name__)\n\n\nclass EligibilityVerifierSelectionForm(forms.Form):\n    \"\"\"Form to capture eligibility verifier selection.\"\"\"\n\n    action_url = \"eligibility:index\"\n    id = \"form-verifier-selection\"\n    method = \"POST\"\n\n    verifier = forms.ChoiceField(label=\"\", widget=widgets.VerifierRadioSelect)\n    # sets label to empty string so the radio_select template can override the label style\n    submit_value = _(\"Choose this benefit\")\n\n    def __init__(self, agency: models.TransitAgency, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        verifiers = agency.active_verifiers\n\n        self.classes = \"col-lg-8\"\n        # second element is not used since we render the whole label using selection_label_template,\n        # therefore set to None\n        verifier_field = self.fields[\"verifier\"]\n        verifier_field.choices = [(v.id, None) for v in verifiers]\n        verifier_field.widget.selection_label_templates = {v.id: v.selection_label_template for v in verifiers}\n        verifier_field.widget.attrs.update({\"data-custom-validity\": _(\"Please choose a transit benefit.\")})\n        self.use_custom_validity = True\n\n    def clean(self):\n        if not recaptcha.verify(self.data):\n            raise forms.ValidationError(\"reCAPTCHA failed\")\n\n\nclass EligibilityVerificationForm(forms.Form):\n    \"\"\"Form to collect eligibility verification details.\"\"\"\n\n    action_url = \"eligibility:confirm\"\n    id = \"form-eligibility-verification\"\n    method = \"POST\"\n\n    submit_value = _(\"Find my record\")\n    submitting_value = _(\"Checking\")\n\n    def __init__(\n        self,\n        title,\n        headline,\n        blurb,\n        name_label,\n        name_placeholder,\n        name_help_text,\n        sub_label,\n        sub_placeholder,\n        sub_help_text,\n        name_max_length=None,\n        sub_input_mode=None,\n        sub_max_length=None,\n        sub_pattern=None,\n        sub_custom_validity=None,\n        name_custom_validity=None,\n        *args,\n        **kwargs,\n    ):\n        \"\"\"Initialize a new EligibilityVerifier form.\n\n        Args:\n            title (str): The page (i.e. tab) title for the form's page.\n\n            headline (str): The <h1> on the form's page.\n\n            blurb (str): Intro <p> on the form's page.\n\n            name_label (str): Label for the name form field.\n\n            name_placeholder (str): Field placeholder for the name form field.\n\n            name_help_text (str): Extra help text for the name form field.\n\n            sub_label (str): Label for the sub form field.\n\n            sub_placeholder (str): Field placeholder for the sub form field.\n\n            sub_help_text (str): Extra help text for the sub form field.\n\n            name_max_length (int): The maximum length accepted for the 'name' API field before sending to this verifier\n\n            sub_input_mode (str): Input mode can be \"numeric\", \"tel\", \"search\", etc. to override default \"text\" keyboard on\n                                  mobile devices\n\n            sub_max_length (int): The maximum length accepted for the 'sub' API field before sending to this verifier\n\n            sub_pattern (str): A regular expression used to validate the 'sub' API field before sending to this verifier\n\n        Extra args and kwargs are passed through to the underlying django.forms.Form.\n        \"\"\"\n        super().__init__(auto_id=True, label_suffix=\"\", *args, **kwargs)\n\n        self.title = title\n        self.headline = headline\n        self.blurb = blurb\n\n        self.classes = \"col-lg-6\"\n        sub_widget = widgets.FormControlTextInput(placeholder=sub_placeholder)\n        if sub_pattern:\n            sub_widget.attrs.update({\"pattern\": sub_pattern})\n        if sub_input_mode:\n            sub_widget.attrs.update({\"inputmode\": sub_input_mode})\n        if sub_max_length:\n            sub_widget.attrs.update({\"maxlength\": sub_max_length})\n        if sub_custom_validity:\n            sub_widget.attrs.update({\"data-custom-validity\": sub_custom_validity})\n            self.use_custom_validity = True\n\n        self.fields[\"sub\"] = forms.CharField(\n            label=sub_label,\n            widget=sub_widget,\n            help_text=sub_help_text,\n        )\n\n        name_widget = widgets.FormControlTextInput(placeholder=name_placeholder)\n        if name_max_length:\n            name_widget.attrs.update({\"maxlength\": name_max_length})\n        if name_custom_validity:\n            name_widget.attrs.update({\"data-custom-validity\": name_custom_validity})\n            self.use_custom_validity = True\n\n        self.fields[\"name\"] = forms.CharField(label=name_label, widget=name_widget, help_text=name_help_text)\n\n    def clean(self):\n        if not recaptcha.verify(self.data):\n            raise forms.ValidationError(\"reCAPTCHA failed\")\n\n\nclass MSTCourtesyCard(EligibilityVerificationForm):\n    \"\"\"EligibilityVerification form for the MST Courtesy Card.\"\"\"\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(\n            title=_(\"Agency card information\"),\n            headline=_(\"Let\u2019s find the record of your transit benefit.\"),\n            blurb=_(\n                \"We use the information on your MST Courtesy Card to find the record of your transit benefit in our system.\"\n            ),\n            name_label=_(\"Last Name\"),\n            name_placeholder=\"Garcia\",\n            name_help_text=_(\n                \"Please enter your last name the same way it is printed on your card, including capital letters and hyphens.\"\n            ),\n            sub_label=_(\"Courtesy Card number\"),\n            sub_help_text=_(\"This is a 5-digit number on the front and back of your card.\"),\n            sub_placeholder=\"12345\",\n            name_max_length=255,\n            sub_input_mode=\"numeric\",\n            sub_max_length=5,\n            sub_pattern=r\"\\d{5}\",\n            sub_custom_validity=_(\"Please enter a 5-digit number.\"),\n            name_custom_validity=_(\"Please enter your last name.\"),\n            *args,\n            **kwargs,\n        )\n\n\nclass SBMTDMobilityPass(EligibilityVerificationForm):\n    \"\"\"EligibilityVerification form for the SBMTD Reduced Fare Mobility ID.\"\"\"\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(\n            title=_(\"Agency card information\"),\n            headline=_(\"Let\u2019s find the record of your transit benefit.\"),\n            blurb=_(\n                \"We use the information on your SBMTD Reduced Fare Mobility ID card to find the record of your transit \"\n                + \"benefit in our system.\"\n            ),\n            name_label=_(\"Last Name\"),\n            name_placeholder=\"Garcia\",\n            name_help_text=_(\n                \"Please enter your last name the same way it is printed on your card, including capital letters and hyphens.\"\n            ),\n            sub_label=_(\"Reduced Fare Mobility ID card number\"),\n            sub_help_text=_(\"This is a 4-digit number on the back of your card.\"),\n            sub_placeholder=\"1234\",\n            name_max_length=255,\n            sub_input_mode=\"numeric\",\n            sub_max_length=4,\n            sub_pattern=r\"\\d{4}\",\n            sub_custom_validity=_(\"Please enter a 4-digit number.\"),\n            name_custom_validity=_(\"Please enter your last name.\"),\n            *args,\n            **kwargs,\n        )\n", "path": "benefits/eligibility/forms.py"}]}